I am using the [Face Recognition and Face Detection api by lambda](https://rapidapi.com/lambda/api/face-recognition-and-face-detection?endpoint=53aa3243e4b07e1f4ebe9bb3) and I need to get a response from the api using post which I need to subscribe to in my angular app. The structure is as follows: an image is passed to **angular app -> Route.js -> function.js**. It then gets processed by the api and passes a post response. Now, since this passes a post response in function.js how do I get it back up the structure **function.js->Route.js->angular app**? From Route.js-> angular I now I can set objects via the res.status(200).json(object) method but how about the response from function.js?

**function.js**

```
this.recognizeImg = (url)=>{
        let requestString = "https://lambda-face-recognition.p.rapidapi.com/recognize";
        let req = unirest("POST", requestString);
        let imgURL = url;

        unirest.post(requestString)
           .header("X-RapidAPI-Key", API_KEY)
           //.field("urls", imgURL)
           .attach("files", fs.createReadStream(createPath(imgURL)))
           .field("album", ALBUM_NAME)
           .field("albumkey", ALBUM_KEY)
           .end(result => {
               console.log("successfully recognized image");
               console.log(result.body);
           });   

    }

```

**Route.js**

```
facedetAPIRoutes.route("/").post(function (req, res){
    let imageUrl = req.body.url;
    myFaceDetAPI.recognizeImg(imageUrl);
    res.status(200).json(myFaceDetAPI.recognizeImg(imageUrl));
});

```