Optimize conversation queries with aggregation pipelines
Refactored conversation and misc routes to use MongoDB aggregation pipelines for counting and paginating conversations, and for efficiently counting assistant messages. This reduces the number of database queries and improves performance, especially for endpoints that require both paginated data and total counts.