APEC closes in Peru with China's President Xi front and centre as Trump whiplash looms