added token authentification and tests