Initial implementation of the server