filter search results with API function