     }
     
     // MARK: - Private methods
+    private func decode<T: Decodable>(_ data: Data, using decoder: JSONDecoder) throws -> T {
+        let model: T
+        if let dataModel = data as? T {
+            model = dataModel
+        } else {
+            model = try decoder.decode(T.self, from: data)
+        }
+        return model
+    }
+    
     private func dump(_ text: String) {
         #if DEBUG
             print("[RESTClient] \(text)")

                
                guard response.status.isSuccessful() else { throw ResponseError.unsuccessful(response) }
                
                let model: Model
                if let dataModel = data as? Model {
                    model = dataModel
                } else {
                    model = try decoder.decode(Model.self, from: data)
                }
                self.queue.async { handler(.success(response, model)) }
            } catch {
                self.queue.async { handler(.failure(error)) }

    }
    
    // MARK: - Instance methods
    public func execute<T: Decodable>(request: URLRequest,
                                      with decoder: JSONDecoder = JSONDecoder(),
                                      handler: @escaping (Result<T>) -> Void) {
        #if os(Linux)
        // See https://gitlab.com/optimisedlabs/URLSessionRegression
        let session = URLSession(configuration: .default)
