       type: "DELETE",
       dataType: "json",
       url: delete_url,
-      error: handle_ajax_error
+      error: tree_error_handler(data)
   else
-    $.jstree.rollback(last_rollback)
-    last_rollback = null
+    $.jstree.rollback(data.rlbk)
 
 @setup_taxonomy_tree = (taxonomy_id) ->
   if taxonomy_id != undefined

    dataType: "json",
    url: url,
    data: ({"taxon[parent_id]": new_parent.prop("id"), "taxon[child_index]": position }),
    error: handle_ajax_error

  true

handle_create = (e, data) ->
  last_rollback = data.rlbk
  node = data.rslt.obj
  name = data.rslt.name
  position = data.rslt.position

    data: {
      "taxon[name]": name,
    },
    error: tree_error_handler(data)

handle_delete = (e, data) ->
  node = data.rslt.obj
  delete_url = "#{base_url}/#{node.prop("id")}"
  if confirm(Spree.translations.are_you_sure_delete)
