sort in api too