Moved check for single-word search from frontend to backend