     case categoryCode
     case number
     case company = "operator" // needed since "operator" is a Swift keyword
+    case to
+    case passList
+    case capacity1st
+    case capacity2nd
   }
 }
 

        transportationsParam += "&transportations[]=\(transportation)"
      }
    }
    
    let url = "https://transport.opendata.ch/v1/connections?"+"from=\(from)&to=\(to)\(dateParam)\(timeParam)\(transportationsParam)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
    return url
  }
  
  static func connectionsForLocations(from: String, to: String, date: String = "", time: String = "", transportations: [TransportationType] = [], completionHandler: @escaping (Connections?, Error?) -> Void) {
    // set up URLRequest with URL
    let endpoint = TransportAPI.endpointForConnections(from: from, to: to, date: date, time: time, transportations: transportations)
    NSLog("Making request "+endpoint)
    guard let url = URL(string: endpoint) else {
      print("Error: cannot create connections URL")

  static func locationsForQuery(_ query: String, type: QueryType = .all, completionHandler: @escaping (Locations?, Error?) -> Void) {
    // set up URLRequest with URL
    let endpoint = TransportAPI.endpointForLocationQuery(query, type: type)
    callURL(endpoint, completionHandler: completionHandler);
    
  }
  
  // MARK: Connections query
  
  static func endpointForConnections(from: String,
                                     to: String,
                                     limit: Int = 4,
                                     page: Int = 0,
                                     date: String = "",
                                     time: String = "",
                                     transportations: [TransportationType] = [],
                                     timeType: TimeType = .departure,
                                     accessibility: AccessibilityType = .any,
                                     options: [OptionsType] = []) throws -> String {
    let fromParam = from == "" ? "" : "from="+from // omit & for first param
    let toParam = to == "" ? "" : "&to="+to
    // Check required params
    if fromParam == "" || toParam == "" {
      throw BackendError.invalidParameter(reason: "The parameters from and to are required")
    }
    
    let limitParam = "&limit="+String(limit)
    let pageParam = "&page="+String(page)
    let dateParam = date == "" ? "" : "&date="+date
    let timeParam = time == "" ? "" : "&time="+time
    var transportationsParam = ""
