updated server implementation