Add json_to_file method