added serialization support to entities and collections