implement the search API for files