function for JSON files parsing