ajax helper returns different structure in case of failure