Making the same improvement for the search API