Assert valid JSON from websocket
Fix error handling