change websockets API to send messages