reading and writing json objects from the server.js