Refactored NotFoundHttpException, closes #1521.