Temporary copy of the api search handler