Upgraded to api v2

changed the code so it works with the new api. the readme still needs to be fixed