API to get / put session state
Tie session state into the rest of the server.
Fix assertions