function loadTree () {
  $.get('apiv2/connection', function (isConnected) {
    if (isConnected) {
      $('#keyTree').on('loaded.jstree', function () {
        var tree = getKeyTree();
        if (tree) {
          var root = tree.get_container().children('ul:eq(0)').children('li');
          tree.open_node(root, null, true);
        }
      });
      $.get('connections', function (data) {
        if (data.connections) {
          connections.list = data.connections;
          data.connections.every(function (instance) {
            // build root objects for jstree view on left side
            var treeObj = {
              id: instance.conId,
              text: instance.label + ' (' + instance.options.host + ':' + instance.options.port + ':' + instance.options.db + ')',
              state: {opened: false},
              icon: getIconForType('root'),
              children: true,
              rel: 'root'
            };
            connections.treeObjects.push(treeObj);
            return true;
         });
        }
        return onJSTreeDataComplete();

        function getJsTreeData(node, cb) {
          if (node.id === '#') return cb(connections.treeObjects);

          var dataUrl;
          if (node.parent === '#') {
              dataUrl = 'apiv2/keystree/' + encodeURIComponent(node.id) + '/';
          }
          else {
              var root = getRootConnection(node);
              var path = getFullKeyPath(node);
              dataUrl = 'apiv2/keystree/' + encodeURIComponent(root) + '/' + encodeURIComponent(path) + '?absolute=false';
          }
          $.get({
              url: dataUrl,
              dataType: 'json'
          }).done(function(nodeData) {
            if (Array.isArray(nodeData.data)) {
              nodeData.data.forEach(function(elem) {
                 if (elem.rel) elem.icon = getIconForType(elem.rel);
              });
            }
            cb(nodeData.data)
          }).fail(function(error) {
            console.log('Error fetching data for node ' + node.id + ': ' + JSON.stringify(error));
            if (error.responseJSON && error.responseJSON.connectionClosed) {
              setRootConnectionNetworkError(true, node)
            }
            cb('Error fetching data');
          });
        }

        function getIconForType(type) {
          switch (type) {
              case 'root': return 'images/treeRoot.png';
              case 'string': return 'images/treeString.png';
              case 'hash': return 'images/treeHash.png';
              case 'set': return 'images/treeSet.png';
              case 'list': return 'images/treeList.png';
              case 'zset': return 'images/treeZSet.png';
              case 'stream': return 'images/treeStream.png';
              case 'binary': return 'images/treeBinary.png';
              case 'ReJSON-RL': return 'images/treeJson.png';
              default: return null;
          }
        }

        function onJSTreeDataComplete () {
          $('#keyTree').jstree({
              core: {
                  data: getJsTreeData,
                  multiple : false,
                  check_callback : true,
                  //themes: {
                  //    responsive: true
                  //}
              },
              contextmenu: {
                  items: function (node) {
                      var menu;
                      var rel = node.original.rel;
                      if (typeof rel === 'undefined' ) {    // folder
                        menu = {
                          'addKey': fullMenu['addKey'],
                          'refresh': fullMenu['refresh'],
                          'export': fullMenu['export'],
                          'remKey': fullMenu['remKey']
                        }
                      }
                      else if (rel === 'root') {     // root connection object (first level in tree-view)
                        menu = {
                          'addKey': fullMenu['addKey'],
                          'refresh': fullMenu['refresh'],
                          'export': fullMenu['export'],
                          'remConnection': fullMenu['remConnection']
                        }
                        if (node.id.startsWith('C:')) {
                          menu['custerNodes'] = fullMenu['custerNodes'];
                        }
                      }
                      else {  // some redis key
                        menu = {
                          'renameKey': fullMenu['renameKey'],
                          'refresh': fullMenu['refresh'],
                          'export': fullMenu['export'],
                          'remKey': fullMenu['remKey']
                        }
                      }
                      if (redisReadOnly) {
                        delete menu['renameKey'];
                        delete menu['addKey'];
                        delete menu['remKey'];
                      }
                      return menu;
                  }
              },
              plugins: [ 'themes', 'contextmenu' ]
          })
          .on('select_node.jstree', treeNodeSelected)
          .delegate('a', 'click', function (event, data2) {
            event.preventDefault();
          })
          .on('keyup', function (e) {
              var key = e.which;
              // delete
              if (key === 46) {
                  var node = getKeyTree().get_selected(true)[0];
                  // do not allow deletion of entire server, only keys within
                  if (node.parent !== '#') {
                    var connId = node.parents[node.parents.length-2];
                    deleteKey(connId, getFullKeyPath(node));
                  }
              }
          });

        }
      });
    }
  });
}
find one connection by their connectionId