Working code of the API of list and detailed view