adjusting ws_gateway to work with api_receive