Fixing issue #138 adding support for Serialization of entities