move from direct entity references to uids in c api (faster)