     /// - parameter session: a session must have a backendConfiguration set.
     /// - parameter final: closure is callen when all requests are performed.
 	public init (session: FaroURLSession, final: @escaping(_ failedTasks: Set<URLSessionTask>?)->()) {
-        taskQueue = Set<URLSessionDataTask>()
+        taskQueue = Set<URLSessionTask>()
         self.final = final
         self.session = session
 	}

    private func shouldCallFinal() {
        if !hasOustandingTasks {
            final(failedTasks)
            FaroURLSession.urlSession?.finishTasksAndInvalidate()
        }
    }

    // MARK: - Invalidate session overrides

    open func invalidateAndCancel() {
        taskQueue.removeAll()
        failedTasks?.removeAll()
        FaroURLSession.urlSession?.invalidateAndCancel()
    }

    deinit {
        FaroURLSession.urlSession?.finishTasksAndInvalidate()
    }

}

    /// Provide a type, that can be an array, to decode the data received from the service into type 'M'
    /// - parameter type: Generic type to decode the returend data to. If service returns no response data use type `Service.NoResponseData`
    @discardableResult
    open func perform<M>(_ type: M.Type, call: Call, autoStart: Bool = false, complete: @escaping(@escaping () throws -> (M)) -> Void) -> URLSessionTask?  where M: Decodable {
        let config = session.backendConfiguration

        guard let request = call.request(with: config) else {
