First working implementation of the server