#34: insert token handling, change enc. for auth.
#34: check old token before gen. a new one.