Updated api to be able to sort objects based on attribute values