Revert "Revert "Add the task in the failure response completion blocks""

This reverts commit dc37d19482f5b4d4fff02c5128d33ff215a1587f.