moved some logic from nodeserver to websockethandler where it belongs