Added the ability to handle 400, 403, 404 and 500 exceptions