added api and new imports for minidom and urllib2