code: function addChild(text, offset, callback){
      if(offset){
        if(isNaN(offset.x)) return callback(new Error('offset.x must be a number'));
        if(isNaN(offset.y)) return callback(new Error('offset.y must be a number'));
      }
      if(text){
          if(typeof text !== 'string') return callback(new Error('text must be string'));
          if(text.length > 3000) return callback(new Error('text too long'));
      }
      var self = this;
      var body = {
           parent: this.id,
           offset: offset,
             text: text
      };
      this.diagram.apiclient.post(
        this.replaceIds('/api/1/diagrams/:diagram/nodes'),
        '',
        body,
        function(err, node){
          if(err)
            return callback(err);
          var api_node = new CoggleApiNode(self.diagram, node);
          api_node.parent_id = self.id;
          self.children.push(api_node);
          return callback(false, api_node);
      });
    }
docs: !jsjsdoc
  
  doc.CoggleApiNode.addChild = {
  $brief: "Add a child to this item. The child is positioned relative to "+
  "this item, and will move when you move this item.",
  $parameters: {
  text: "Text to add for the item.",
  offset: {
  $type: "Object: {x:Number, y:Number}",
  $brief: "Offset of the new item from this one. The `x` coordinate "+
  "is along the branch direction, the `y` coordinate is "+
  "vertically down from the top of the document."
  },
  callback: {
  $type: "Function",
  $brief: "Callback accepting (Error, CoggleApiNode)",
  }
  }
  }