better oAuth flow and fixes for everything I broke