magento2 – the getTree function returns null

I need to get the category tree to add information to the API response, but when I call the getTree () method in

 Magento  Catalog  Model  Category  Tree 

It returns the empty result.

Here is my code:

/ **
* @var  Magento  Catalog  Model  CategoryFactory
* /
private $ categoryFactory;


/ **
* @var  Magento  Catalog  Api  CategoryRepositoryInterface
* /
private $ categoryRepositoy;

/ **
* @var  Magento  Catalog  Model  Category  Tree
* /
private $ categoryTree;

/ **
*
* @param int $ categoryId
* @return string
* /
public function getImage ($ categoryId) {
$ category = $ this-> categoryFactory-> create ();
$ category = $ category-> load ($ categoryId);
if ($ categoryId) {
// $ category = $ this-> getCategory ($ categoryId);
$ image = $ category-> getImageUrl ();
returns $ image;
}

return "Category id is null";
}

/ **
* @api
* @return array
* /
Public function getCategoriesInformation () {
$ category = $ this-> categoryFactory-> create ();
$ collection = $ category-> getCollection ();

// $ category = $ category-> load ($ categoryId);
// $ category = $ category-> getTree ($ categoryId);
$ arr = array ();
$ i = 1;
foreach ($ collection as $ item) {
// array_push ($ arr, $ item-> getData ());
$ id = (int) $ item-> getData ()['entity_id'];
$ category = $ this-> categoryRepositoy-> get ($ id);
$ arr[$i]["categoryId"]    = $ id;
$ arr[$i]["categoryName"]    = $ category-> getName ();
$ arr[$i]["parentId"]    = $ category-> getParentId ();
$ arr[$i]["categorychildren"]    = $ category-> getChildren ();
$ arr[$i]["Image"]    = $ this-> getImage ($ id);
$ arr[$i]["tree"]    = $ this-> categoryTree-> getTree ($ this-> categoryTree-> getRootNode ($ category));
$ i ++;
}
returns $ arr;
}

and that is one of the elements of the output:

    {
"categoryId": 1,
"categoryName": "Root Catalog",
"parentId": "0",
"categorychildren": "2,14",
"Image": false,
"tree": {}
}