         }
         return T()
     }
-    
-    func doInWriteBlock(closure:() -> (), completion: ()->Void = {}) {
-        let realm = try! Realm()
-        try! realm.write {
-            closure()
-            completion()
-        }
-    }
-}
+}

    /**
     - important: All params except **type** and **url** are optional
     - parameters:
     - type: Object type
     - url: String with url
     - method: Use this parameter in your method call if you want to override *defaultMethod* property
     - parameters: Call parameters in `[String:Any]` format
     - paramsEncoding: Use this parameter in your method call if you want to override *defaultParamEncoding* property
     - headers: Use this parameter in your method call if you want to override *defaultHeaders* property
     - saveResponseToRealm: Use this parameter in your method call if you want to override *automaticalySaveToRealm* property
     - success: Success completion block with received object
     - objects: Objects that are included in success completion block
     - fail: Failure completion block with *SimpleApiError* param. If this param is **.fail**, additional *Error* param is included
     - apiError: Always included in fail block
     - error: Appears in fail block if *apiErrors* value is **.fail**
     */
    public func getArray<T:Object>(type:T.Type,
                          url:String,

        let reachability = sender.object as! Reachability
        
        if reachability.isReachable {
            //on first change, don't react to the notification of connection change
            if firstChange == true {
                firstChange = false
                return
