             sessionDownloadTask.forEach({ forEach($0) })
         }
     }
+
+    private static func commonResponse<T>(
+        preloader uuid: String,
+        preloaderType: PreloaderType,
+        response: DataResponse<T>,
+        completionHandler: ((DataResponse<T>) -> Void)?, withSaveContext: Bool
+        ) {
+        
+        hidePreloader(uuid, type: preloaderType)
+        switch response.result {
+        case .failure(let error):
+            print("error \(error)")
+            if (error as NSError).code == NSURLErrorCancelled {
+                // nothing
+            } else {
+                completionHandler?(response)
+            }
+            break
+        default:
+            completionHandler?(response)
+        }
+        
+        if withSaveContext {
+            switch response.result {
+            case .success:
+                DatabaseHelper.sharedInstance.saveContext()
+            case .failure: break
+            }
+        }
+    }
+    
+    private static func validate(request: URLRequest?, response: HTTPURLResponse, data: Data?) -> DataRequest.ValidationResult {
+        if
+            let data = data,
+            response.statusCode >= 200,
+            response.statusCode < 300
+        {
+            do {
+                try JSONSerialization.jsonObject(with: data, options: [])
+                return DataRequest.ValidationResult.success
+            } catch {
+            }
+        }
+        return DataRequest.ValidationResult.failure(PareseError.invalid)
+    }
+    
 }

        urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
        
        let request = sessionManager.request(urlRequest)
        
        request.responseArray { (response: DataResponse<[T]>) in
            switch response.result {
            case .failure(let error):
                print("error \(error)")
                if (error as NSError).code == NSURLErrorCancelled {
                    // nothing
                } else {
                    completionHandler(response)
                }
                break
            default:
                completionHandler(response)
            }
            }
            .validate { (requst, response, data) -> Request.ValidationResult in
                if
                    let data = data,
                    response.statusCode >= 200,
                    response.statusCode < 300
                {
                    do {
                        try JSONSerialization.jsonObject(with: data, options: [])
                        return DataRequest.ValidationResult.success
                    } catch {
                        
                    }
                }
                
                return DataRequest.ValidationResult.failure(PareseError.invalid)
        }
    }
    
    public static func simpleRequestWithHttpBody<T: BaseMappable> (url:URL,
                                                 httpBody:Data?,
                                                 method: HTTPMethod = .get,
                                                 headers: HTTPHeaders? = nil,
                                                 completionHandler: @escaping (DataResponse<T>) -> Void) {
        
        var urlRequest = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 15)
        urlRequest.httpBody = httpBody
        urlRequest.httpMethod = method.rawValue

        preloaderType: PreloaderType = .small,
        withSaveContext: Bool = true,
        beforeMapping: ((DefaultDataResponse) -> Void)? = nil,
        completionHandler: ((DataResponse<[T]>) -> Void)? = nil
        ) {
        
        let request = sessionManager.request(url, method: method, parameters: parameters, encoding: encoding, headers: headers)
        let uuid = UUID().uuidString
        showPreloader(uuid, type: preloaderType)

        request
            .response { response in
                beforeMapping?(response)
            }
            .responseArray { (response: DataResponse<[T]>) in
                commonResponse(preloader: uuid, preloaderType: preloaderType, response: response, completionHandler: completionHandler, withSaveContext: withSaveContext)
            }
            .validate { request, response, data in
                return validate(request: request, response: response, data: data)
        }
    }
    
    public static func simpleRequestWithHttpBody<T: BaseMappable> (
        url:URL,
        httpBody:Data?,
        method: HTTPMethod = .get,
        headers: HTTPHeaders? = nil,
        preloaderType: PreloaderType = .small,
        withSaveContext: Bool = true,
        beforeMapping: ((DefaultDataResponse) -> Void)? = nil,
        completionHandler: @escaping (DataResponse<[T]>) -> Void
        ) {

        var urlRequest = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 15)
        urlRequest.httpBody = httpBody
        urlRequest.httpMethod = method.rawValue
