return promises in http