Implment to communicate with server.