Savepoint. Fixing authentication and access_token renewal.

I think all the use cases have been tested successfully. Though I still need to test more
Fix issue with DB synchronisation