I need to wait for a api response to return before the subsequent result to be executed. So I tried with promise calls in js. But still it doesn\'t wait for the api response. My