I re-implemented that to not use the search endpoint a while ago. The endpoint already ensures that params["text"] exists before this function is called.