Updated middleware and added configurable handlers for 403 (and other status codes)