Rewriting Chat client to use main api