extraxt a search method to the api