Changes to read and write parts of server.