 
                     // http status
                     let status = response.response?.statusCode
-                    if status == 200 {
-                        let jsonDic = response.result.value as! NSDictionary
+
+                    switch response.result {
+                    case let .success(value):
+                        print(value)
+                        let jsonDic = value as! NSDictionary
                         // dump(jsonDic)
 
                         let breinResult = BreinResult(dictResult: jsonDic)
                         successBlock(breinResult)
-                    } else {
-                        /*
-                         let httpError: NSError = response.result.error!
-                         let statusCode = httpError.code
-                         */
+                    case let .failure(error):
+                        print(error)
                         let error: NSDictionary = ["error": "httpError",
                                                    "statusCode": status!]
                         failureBlock(error)

                    // print(response.result.value)

                    // http status
                    let status = response.response?.statusCode
                    if status == 200 {
                        let jsonDic = response.result.value as! NSDictionary
                        // dump(jsonDic)

                        let breinResult = BreinResult(dictResult: jsonDic)
                        success(breinResult)
                    } else {
                        /*
                         let httpError: NSError = response.result.error!
                         let statusCode = httpError.code
                         */
                        let error: NSDictionary = ["error": "httpError",
                                                   "statusCode": status!]
                        failure(error)
                    }
                }
    }

    /**
     Invokes the post request for lookups
     
     - parameter breinLookup: lookup object
     - parameter success success: will be invoked in case of success
     - parameter failure failure: will be invoked in case of an error


        do {
            let jsonData = try! JSONSerialization.data(withJSONObject: body as Any, options: JSONSerialization.WritingOptions.prettyPrinted)
            _ = NSString(data: jsonData, encoding: String.Encoding.utf8.rawValue)! as String

            // print(jsonString)
        }

        AF.request(url, method: .post,
                        parameters: body,
                        encoding: JSONEncoding.default)
                .responseJSON {
