 
             result = {}
             result.models = _.map(data, (attrs) -> $model.make_model(name, attrs, cls))
-            result.count = currentHeaders["x-pagination-count"]
-            result.current = currentHeaders["x-pagination-current"]
-            result.paginatedBy = currentHeaders["x-paginated-by"]
+            result.count = parseInt(currentHeaders["x-pagination-count"], 10)
+            result.current = parseInt(currentHeaders["x-pagination-current"] or 1, 10)
+            result.paginatedBy = parseInt(currentHeaders["x-paginated-by"], 10)
 
             defered.resolve(result)
 

    service.getIssue = (projectId, issueId) ->
        return queryOne("issues", issueId, {project:projectId})

    service.getIssueHistorical = (projectId, issueId, filters={}) ->
        urlParams = [issueId]
        parameters = _.extend({}, filters, {project:projectId})
        return queryManyPaginated("issues-historical", parameters, null , null, urlParams)

    service.getIssuesFiltersData = (projectId) ->

    service.getUserStory = (projectId, userStoryId) ->
        return queryOne("userstories", userStoryId, {project:projectId})

    service.getUserStoryHistorical = (userStoryId, filters={}) ->
        urlParams = [userStoryId]
        parameters = _.extend({}, filters)
        return queryManyPaginated("userstories-historical", parameters, null , null,
                                  urlParams)

