Implement sorting in the API, change the api docs to reflect.