expose mongo search query for an api request