Update writeJson to write entire json file.