added responseJSON as a callback to onAfterComplete