we need two types of request handlers: xhr and websocket