first draft of json serialization of entities, but deserialization is missing