Fix the value of the content-range header for endpoints that have criteria

Right now the content range returns a count of all items, not just items that match the criteria supplied, which makes it somewhat useless for pagination of filtered lists. Pull request fixes the issue.