     }
   }
 
+  struct Playlist {
+    let id: String
+    let name: String
+
+    static func from(_ dict: [String: Any]) -> Playlist {
+      let id = dict["id"] as! String
+      let name = dict["name"] as! String
+
+      return Playlist(id: id, name: name)
+    }
+  }
+
   var db: DB
 
   var credentials: Credentials {

      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?
