Adapted Javascript to use the new JSON structure.