Fully functional login and register with session, adjusted model functions and commented out the ones caught with errors