Added full functionality of login and chat.