Working for products api. modified the function for listing products thorough api