 
 private extension String {
     func replaceSpacesWithPluses() -> String {
-        return self.replacingOccurrences(of: " ", with: "+")
+        return replacingOccurrences(of: " ", with: "+")
+    }
+
+    func addStorefront(_ storefront: Storefront) -> String {
+        return replacingOccurrences(of: "{storefront}", with: storefront.rawValue)
+    }
+
+    func addId(_ id: String) -> String {
+        return replacingOccurrences(of: "{id}", with: id)
+    }
+
+    func addMediaType(_ mediaType: MediaType) -> String {
+        return replacingOccurrences(of: "{mediaType}", with: mediaType.rawValue)
     }
 }

        static let searchTypes = "types"

        // Fetch
        // TODO: Construct this from the media type
        static let artistPath = "v1/catalog/{storefront}/artists/{id}"
        static let albumsPath = "v1/catalog/{storefront}/albums/{id}"
        static let songsPath = "v1/catalog/{storefront}/songs/{id}"
        static let playlistsPath = "v1/catalog/{storefront}/playlists/{id}"
        static let musicVideosPath = "v1/catalog/{storefront}/music-videos/{id}"
    }

    private var baseApiUrl: URL {

            components.queryItems = [query]
        }

        components.path = AppleMusicApi.fetchPath.addStorefront(storefront).addMediaType(mediaType).addId(id)

        return components.url(relativeTo: baseApiUrl)!.absoluteURL
    }

    // MARK: Construct requests
