Add sorting capabilities to the RESTful API