Implement XML and JSON API