[webapi] Add handlers for websocket server

- Integrate handlers from w3c tests, these files are needed by websocket server
Merge pull request #426 from haoxli/haoxli/webapi/websocket-hanlder

[webapi] Add handlers for websocket server