Added abillity to set custom headers on error or success