refactored HTTP error (e.g. custom 404) handling some.