API sorting and filtering