Fixing json file update (to keep indentation instead of flattening the file)