How was the forbidden city used to legitimize the rule of the ming and qing emperors?.