core chat functionality implemented