insert rest api tree