Fix invalid variable for success callback; add failure callback