Move entity limit to middleware.