add test for websocket api
fix style