pass in authentication method from outside
work with json structures for chat