Changed the websocket server

Changed the server so that it validates constraints.