Handling token expiration

Fixes #54