fix bug: in api 'name_to_refid'