I now have what appears to be a working add_node function for tree, one which successfully can traverse the array searching for a matching id to the provided parent id