     ///
     /// https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
     public func releases(in repository: Repository, page: UInt = 1, perPage: UInt = 30) -> SignalProducer<(Response, [Release]), Error> {
-        return fetchMany(repository.releases, page: page, pageSize: perPage)
+        return execute(repository.releases, page: page, pageSize: perPage)
     }
     
     /// Fetch the release corresponding to the given tag in the given repository.

            .url(with: queryItems)

        self.init(string: url.absoluteString)!
    }
}

extension URLRequest {
    internal static func create(_ url: URL, _ credentials: Client.Credentials?, contentType: String? = Client.APIContentType) -> URLRequest {
        var request = URLRequest(url: url)
        
        request.setValue(contentType, forHTTPHeaderField: "Accept")
        
        if let userAgent = Client.userAgent {
            request.setValue(userAgent, forHTTPHeaderField: "User-Agent")
        }
        
        if let credentials = credentials {
            request.setValue(credentials.authorizationHeader, forHTTPHeaderField: "Authorization")
        }
        
        return request
    }

    internal static func create(_ url: URL, _ body: Data?, _ method: Method, _ credentials: Client.Credentials?, contentType: String? = Client.APIContentType) -> URLRequest {
        var URLRequest = create(url, credentials, contentType: contentType)
        URLRequest.httpMethod = method.rawValue
        URLRequest.httpBody = body
        return URLRequest
    }
}


    }
    
    /// Fetch a list of objects from the API.
    internal func execute<Resource: ResourceType>(
        _ request: Request<[Resource]>,
        page: UInt?,
        pageSize: UInt?
    ) -> SignalProducer<(Response, [Resource]), Error> where Resource.DecodedType == Resource {
        let nextPage = (page ?? 1) + 1
        return execute(request, page: page, pageSize: pageSize)
            .attemptMap { (response: Response, json: Any) in
                return decode(json)
                    .map { resource in
                        (response, resource)
                    }
                    .mapError(Error.jsonDecodingError)
            }
            .flatMap(.concat) { response, json -> SignalProducer<(Response, [Resource]), Error> in
                return SignalProducer(value: (response, json))
                    .concat(response.links["next"] == nil ? SignalProducer.empty : self.execute(request, page: nextPage, pageSize: pageSize))
            }
    }
}

