Before and after callbacks for routes.