API endpoint to get the next schedules