         onError(error: error, description: error.localizedDescription)
         return
       }
-      var err: NSError?
-      var jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &err) as? Dictionary<String, AnyObject>
-      //println(NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &err))
-      if let err = err {
-        onError(error: err, description: err.localizedDescription)
-        return
-      }
-      if let jsonResult = jsonResult {
-        var results: Dictionary = jsonResult as Dictionary
-        if results["success"] as AnyObject? as? Int == 0 {
-          let data: Dictionary<String, AnyObject>? = results["data"] as AnyObject? as? Dictionary<String, AnyObject>
-          let error = data!["error"] as AnyObject? as String?
-          if let error = error {
-            dispatch_async(dispatch_get_main_queue(), {
-              onError(error: NSError(), description: error)
-            })
-          } else {
-            dispatch_async(dispatch_get_main_queue(), {
-              onError(error: NSError(), description: "error")
-            })
-          }
-          return
-        }
-        let data: [AnyObject]? = results["data"] as AnyObject? as? [AnyObject]
-        
-        
-        if let data = data {
+      self.imgurResponseParser(data: data, completionHandler: { (data, error, errorDescription) -> () in
+        if errorDescription != nil {
+          dispatch_async(dispatch_get_main_queue(), {
+            onError(error: error!, description: errorDescription!)
+          })
+        } else {
+          let data = data as [AnyObject]
           var galleryItems:[GalleryItem] = []
           for galleryDict in data {
             if (galleryDict["is_album"] as AnyObject! as Int! == 1) {

    task.resume()
  }
  
  func getGalleryImagesWithSection(section:ImgurSection, sort:ImgurSort, window:ImgurWindow, page:Int, showViral:Bool, onCompletion:DMArrayBlock, onError:DMErrorStringBlock) {
    let urlSetup = "\(self.restConfig.galleryURI)/\(section.toRaw())/\(sort.toRaw())/\(window.toRaw())/\(page)?showViral=\(showViral)"
    let url = NSURL(string: self.createQueryEndpointFor(urlSetup))

          dispatch_async(dispatch_get_main_queue(), {
            onCompletion(array: galleryItems)
          })
        }
      })
    })
    task.resume()
  }
