Flatten and Unflatten json files