FAIMS-361: updating map logic to properly save and update entities and relationships