making search api route search platform agnostic