filter and sort functions for get request