working the communication between client and server