Start rewriting session related code to use websocket events