Fnished part of the server implementation, needs more work and utility methods