fixing xml and json handling