Fix auth functions
WIP: converting app request handlers