public boolean terminateVirtualMachine(String id) throws Exception
	{
		CloudStackApiClient client = new CloudStackApiClient(DESTROY_VIRTUALMACHINE, apiKey, secretKey, apiUrl);
		client.addParam("id", id);
		String response = client.execute();

		if (containsErrorMessage(response))
		{
			List<String> vms = listServerIds();

			if (vms.contains(id))
			{
				throw new Exception("Error terminating instance with id:" + id + " Response:" + getErrorMessage(response));
			}
			else
			{
				return true;
			}

		}

		Document doc = stringToXmlDocument(response);
		return doc.getElementsByTagName("jobid").getLength() > 0;
	}