Adding code for server and clients