Deleted unused functions and moved esablishSession() to inside the callback of createAndSaveUser()