 
         return data
 
-    _queryMany: (name, params, options, urlParams) ->
+    _queryMany: (name, params, options) ->
         defaultHttpParams = {
             method: "GET",
             headers:  @_headers(),
             url: @gmUrls.api(name, urlParams)
         }
 
+        httpParams = _.extend({}, defaultHttpParams, options)
         if not _.isEmpty(params)
-            defaultHttpParams.params = params
-
-        httpParams = _.extend({}, defaultHttpParams, options)
-        defered = @q.defer()
-
+            httpParams.params = params
+
+        defered = @q.defer()
         promise = @http(httpParams)
+
         promise.success (data, status) =>
             models = _.map data, (attrs) => @model.make_model(name, attrs)
             defered.resolve(models)
 
         promise.error (data, status) ->
-            defered.reject(data, status)
-
-        return defered.promise
-
-    _queryRaw: (name, id, params, options, cls) ->
+            defered.reject(data)
+
+        return defered.promise
+
+    _queryRaw: (name, id, params, options) ->
         defaultHttpParams = {method: "GET", headers:  @_headers()}
+        httpParams =  _.extend({}, defaultHttpParams, options)
 
         if id
-            defaultHttpParams.url = "#{@gmUrls.api(name)}/#{id}"
+            httpParams.url = "#{@gmUrls.api(name)}/#{id}"
         else
-            defaultHttpParams.url = "#{@gmUrls.api(name)}"
+            httpParams.url = "#{@gmUrls.api(name)}"
 
         if not _.isEmpty(params)
-            defaultHttpParams.params = params
-
-        httpParams =  _.extend({}, defaultHttpParams, options)
-
-        defered = @q.defer()
-
+            httpParams.params = params
+
+        defered = @q.defer()
         promise = @http(httpParams)
+
         promise.success (data, status) ->
-            defered.resolve(data, cls)
-
-        promise.error (data, status) ->
-            defered.reject()
+            defered.resolve(data)
+
+        promise.error (data, status) ->
+            defered.reject(data)
 
         return defered.promise
 
     _queryOne: (name, id, params, options, cls) ->
         defaultHttpParams = {method: "GET", headers:  @_headers()}
+        httpParams =  _.extend({}, defaultHttpParams, options)
+
+        if not _.isEmpty(params)
+            httpParams.params = params
 
         if id
-            defaultHttpParams.url = "#{@gmUrls.api(name)}/#{id}"
+            httpParams.url = "#{@gmUrls.api(name)}/#{id}"
         else
-            defaultHttpParams.url = "#{@gmUrls.api(name)}"
-
-        if not _.isEmpty(params)
-            defaultHttpParams.params = params
-
-        httpParams =  _.extend({}, defaultHttpParams, options)
-
-        defered = @q.defer()
-
+            httpParams.url = "#{@gmUrls.api(name)}"
+
+        defered = @q.defer()
         promise = @http(httpParams)
+
         promise.success (data, status) =>
             defered.resolve(@model.make_model(name, data, cls))
 
         promise.error (data, status) ->
-            defered.reject()
+            defered.reject(data)
 
         return defered.promise
 

            headers: @_headers(false),
            url: @gmUrls.api(name, urlParams)
        }
        if not _.isEmpty(params)
            defaultHttpParams.params = params

        httpParams =  _.extend({}, defaultHttpParams, options)
        defered = @q.defer()

        promise = @http(httpParams)
        promise.success (data, status, headersFn) =>
            currentHeaders = headersFn()



        # Second step: make user story models
        _makeUserStoryModels = (milestone) =>
            objects = _.map milestone.user_stories, (obj) =>
                @model.make_model("userstories", obj)
            milestone.user_stories = objects

            return milestone

