Add structure for entity saving
Implement entity saving