simplify error handling logic in browser http client and append http status code to errors before invoking callbacks