trimed the query before parsing to search API, otherwise it will throw an error in search api if there space before/after the query