Registering users and  all functions requiring login