added support for a token being passed in the query string