Added api v2 support

ok, well I expect you will remove it from the PR :-)