insert or update, and remove tags (add tags are not implemented)