implement all server functions