naive implementation of the server