implemented methods in client and server