APEC summit ends with condemnation of terror