Adds ability to fetch meesages for some given query