Adding promise and json response type