APEC closes in Peru with China’s President Xi front and center as Trump whiplash looms