renderJSON(Api.toJson(Trip.find("pattern.route.agency = ?", agency).fetch(), false));
}
else if (patternId != null && calendarId != null) {
TripPattern pattern = TripPattern.findById(patternId);
ServiceCalendar calendar = ServiceCalendar.findById(calendarId);
renderJSON(Api.toJson(Trip.find("byPatternAndServiceCalendar", pattern, calendar).fetch(), false));
}
else if(patternId != null) {
TripPattern pattern = TripPattern.findById(patternId);