making a logged in api check in root scope