Currently, when deleting a contact using the “delete contact” API only the contact is deleted. The problem is that it leaves any associated account empty if there was a single user associated to that account.
Suggested fix: add a parameter in the API call to:
A/ also remove the associated account associated to contact if empty
B/ remove the contact, the account and all contacts associated to this account
(One or the other is enough but other users mays have both needs.)
