     }
   }
 
+  private func apiRequest(_ route: String, method: HTTPMethod? = nil, body: Data? = nil) -> JSONResponse {
+    return apiRequest(URL(string: "https://api.spotify.com/v1/\(route)")!, method: method, body: body)
+  }
+
   private func apiRequest(_ route: String, method: HTTPMethod? = nil, body: String? = nil) -> JSONResponse {
     return apiRequest(route, method: method, body: body?.data(using: .utf8))
   }

      method: .POST,
      body: try! JSONEncoder().encode(["uris": [trackUri]])
    )
  }
}


    return encoded!.base64EncodedString()
  }

  static func synchronousRequest(_ url: URL, headers: [String: String]? = nil, method: HTTPMethod? = nil, body: String? = nil) -> JSONResponse {
    return Utils.synchronousRequest(url, headers: headers, method: method, body: body?.data(using: .utf8))
  }

  static func synchronousRequest(_ url: URL, headers maybeHeaders: [String: String]? = nil, method maybeMethod: HTTPMethod? = nil, body: Data? = nil) -> JSONResponse {
    let method = maybeMethod ?? .GET
    let headers = maybeHeaders ?? [:]

    var data: Data?
    var response: HTTPURLResponse!
    var error: Error?
