supporting token passed to api constructor
adding test for token as config