added support for xml and text/plain responses