xml and json response. unified response handling