http request promise handlers and error handling