Add some state management to the server.