finish server implementation