The returned object from the REST API could contain other objects in the properties object (on a document for instance}}, or in the contextParameters object.
Try, if possible, to unmarshal objects with an entity-type attribute to replace them with Document, User, Group or DirectoryEntry objects.