Added login and check if logged in api