Started process of refactoring authentication between frontend and backend