Enable instant login API & added events for login/logout

what is this black magic :)