     @objc @discardableResult func fetchJSON(readingOptions: JSONSerialization.ReadingOptions = [], success: @escaping (_ response: Any?) -> Void, failure: @escaping ResponseErrorBlock) -> URLSessionDataTask {        
         return self.fetchData(success: { (data) in
             do {
-                success(try JSONSerialization.jsonObject(with: data, options: readingOptions))
+                let jsonObj = try JSONSerialization.jsonObject(with: data, options: readingOptions)
+                DispatchQueue.main.async {
+                    success(jsonObj)
+                }
             } catch {
-                failure(ResponseErrorType.decoding)
+                DispatchQueue.main.async {
+                    failure(ResponseErrorType.decoding)
+                }
+                
             }
         }, failure: { (error) in
-            failure(error)
+            DispatchQueue.main.async {
+                failure(error)
+            }
+            
         })
     }
 }

        
        return self.fetchData(success: { (data) in
            do {
                success(try decoder.decode(decodeable, from: data))
            } catch {
                failure(ResponseErrorType.decoding)
            }
            
        }, failure: { (error) in
            failure(error)
        })
        
    }

                    debugPrint(try JSONSerialization.jsonObject(with: self.request.httpBody!, options: [.mutableLeaves, .mutableContainers]))
                } catch {
                    debugPrint(error)
                }                
            }
        #endif
        queue.async {
            
            self.currentSessionDataTask = self.currentSession.dataTask(with: self.request, completionHandler: { (data, response, error) in
