api for search functionality