When creating new template via API, and I add existing group but add host that does not exists. API create a template and seems also create a new host instead of error message that host doesn't exists.
This behavior leads to problems in web interface, when template is deleted and I want to delete group, even no other host is assigned to group system refuse delete group because it thinks that it is assigned to host, how ever in the details of group it is not shown to be assigned to any host. So it seems it is assigned to "ghost" host created by API when template was created with non existing host, and the host is not displayed in web interface at all.