class DirectionApiLogic {

	public BestTransportResult fromTo(String origin, String destination, TravelMode mode) {
		DirectionsRoute[] routes = this.calls.fromTo(origin, destination, mode);
		if (mode == TravelMode.TRANSIT) {
			return new BestTransportResult(mode, findBestArrivalTime(routes));
		}
		return new BestTransportResult(mode, findBestRoute(routes));
	}

}