Reading and writing json file.