Added entity data creation, and correctly stored entity type.