Json format was not proper as we were writing individual dictionary separately in file. For json, file shud contain only one single dict with all other dicts inside it. For now, not sure how to do this and hence keeping all the data in RAM and finally writiing it in file. This may cause memory issue