fixes for REST and work on WebSockets