First working version of login and app events