I suspect there is a typo here:
zabbix-1.8.8$ grep -nir hstid *
frontends/php/api/classes/class.cusermacro.php:822: else if(isset($upd_templates[$exst_macro['hstid']]))
I don't know if it affects, but I want to use the api to updating several host macros, and I found that reading the code. I suppose that should be changed to hostid , isn't it ?