fixed filtering query when limiting the output for a GET