added api_version and changed api_url methods to work with different endpoints