Moved where req/res are extended, so errors have access to locals.