         return validLatitudes && validLongitudes
     }
     
-    /// Completion function to call once Network.getRoutes returns
     func requestDidFinish(perform actions: [RequestAction]) {
         
         for action in actions {

                banner?.show(queuePosition: .front, on: navigationController)
                isBannerShown = true
                
//                let payload = GetRoutesErrorPayload(type: error.domain,
//                                                    description: error.userInfo["description"] as? String ?? "",
//                                                    url: error.userInfo["url"] as? String)
                RegisterSession.shared?.log(payload)
                
            case .hideBanner:

    func searchForRoutes() {
      
        if let searchFrom = searchFrom,
           let searchTo = searchTo,
           let time = searchTime,
           let startPlace = searchFrom as? CoordinateAcceptor,
           let endPlace = searchTo as? CoordinateAcceptor {
            
            showRouteSearchingLoader = true
            self.hideRefreshControl()

            routes = []
            routeResults.contentOffset = .zero
            routeResults.reloadData()

            // Prepare feedback on Network request
            mediumTapticGenerator.prepare()

            let sameLocation = (searchFrom.name == searchTo.name)
            if sameLocation {
                requestDidFinish(perform: [.showAlert(title: "You're here!", message: "You have arrived at your destination. Thank you for using our TCAT Teleporation™ feature (beta).", actionTitle: "😐😒🙄")])
                return
            }
            
            Network.getCoordinates(start: startPlace, end: endPlace) { (startCoord, endCoord, coordinateVisitorError) in
                
                guard let startCoord = startCoord, let endCoord = endCoord else {
                    self.processNoCoordinates(coordinateVisitorError: coordinateVisitorError)
                    return
                }
                
                if !self.validCoordinates(startCoord: startCoord, endCoord: endCoord) {
                    self.processInvalidCoordinates()
                    return
                }
                
                Network.getRoutes(startCoord: startCoord, endCoord: endCoord, destinationName: searchFrom.name, time: time, type: self.searchTimeType) { request in
                    let requestUrl = Network.getRequestUrl(startCoord: startCoord, endCoord: endCoord, destinationName: searchTo.name, time: time, type: self.searchTimeType)
                    self.processRequest(request: request, requestUrl: requestUrl, destinationName: searchTo.name)
                }
                
            }
        }
    }
    
    func processNoCoordinates(coordinateVisitorError: CoordinateVisitorError?) {
        if let coordinateVisitorError = coordinateVisitorError {
            
            self.requestDidFinish(perform: [
                .showError(bannerInfo: BannerInfo(title: "Could not connect to server", style: .danger),
                           payload: GetRoutesErrorPayload(type: coordinateVisitorError.title, description: coordinateVisitorError.description, url: nil))
                ])
            
        } else {
            
            self.requestDidFinish(perform: [
                .showError(bannerInfo: BannerInfo(title: "Could not connect to server", style: .danger),
                           payload: GetRoutesErrorPayload(type: "Nil start and end coordinates and nil coordinateVisitorError", description: "", url: nil))
                ])
            
        }
    }
    
    func processInvalidCoordinates() {
        let title = "Location Out Of Range"
        let message = "Try looking for another route with start and end locations closer to Tompkins County."
        let actionTitle = "OK"
        
        self.requestDidFinish(perform: [
            .showAlert(title: title, message: message, actionTitle: actionTitle),
            .showError(bannerInfo: BannerInfo(title: title, style: .warning),
                       payload: GetRoutesErrorPayload(type: title, description: message, url: nil))
            ])
    }
    
    func processRequest(request: APIRequest<JSON, Error>, requestUrl: String, destinationName: String) {
        request.perform(withSuccess: { routeJson in
            self.processRouteJson(routeJSON: routeJson, requestUrl: requestUrl)
        },
                        failure: { requestError in
                            self.processRequestError(error: requestError, requestUrl: requestUrl)
        }
        )
        
        let payload = DestinationSearchedEventPayload(destination: destinationName,
                                                      requestUrl: requestUrl,
                                                      stopType: nil)
        RegisterSession.shared?.log(payload)
    }
    
    func processRouteJson(routeJSON: JSON, requestUrl: String) {
