count queries remove orderby then add back in for JSON response