Store new related entities in many-many type relationships.
Fix copy-paste mistake.
Implement handling of has-many type relations.