Ajax calls for XML and JSON fixed