Writing to and getting data from server.