Server: implement the websocket API as a REST API