Abstraction of list function for rest api service