implemented the api using http service of angular