Update GatewayCtrl.js

Return 500 when type is unknown