Remove the protocol element from the settings
api.protocols
and redirecting to the desired protocol should not be done in code. This should be done by the server (it is anyway), there is no need for extra complication of a final check by ApiOpenStudio for this.
Edited by laughing man