Move from JsonObject to JsonElement so that both arrays entity and object entities are managed.