[Issue 6531] Modify updateref to generate referrals on the backend