Adding a very rough sketch of the server code so far.