Created ajax calls for JSON and XML.