What office did the emperor rule through?