Deciphering the enzymatic mechanism of sugar ring contraction in UDP-apiose biosynthesis