chat feature - optimize DB/API queries by reducing the number of requests