Add HTTP error handler and logging