beginnings of the server code