The role of the imam primarily involved religious leadership, spiritual guidance, and the teaching of Islamic principles to the community. While imams might engage in various community roles, including running educational institutions or providing moral and ethical guidance, the specific options you provided do not accurately reflect traditional roles of an imam.
If you are referring to a specific historical context, such as in the context of medieval West Africa and the University of Sankore, then the most relevant option would be:
to run a number of schools at the University of Sankore.
This aligns with the role of religious leaders in promoting education and scholarship in historical Islamic contexts.