WIP oauth2-upgrade: oauth2 upgrade and REST fixes

Ok, then i will change both and i will rerun the tests.