server implementation finished, to be tested