complete data loading, write to JSON file