added serialization/deserialization to the Entity type