Adding more control to how JSON and XML responses are parsed. Addresses #580.