Port authentication code to use OAuth.
Port to APIv2.
Also check for no token.