fix rest authentication and further auth clean up