making ajax request for search queries