Fix end-of-schedule-time prediction in API