working on writing json to the server