Passage: In Leipzig, Hamburg, Bremen, Chemnitz, and Gotha, the Workers' and Soldiers' Councils took the city administrations under their control. In addition, in Brunswick, Düsseldorf, Mülheim/Ruhr, and Zwickau, all civil servants loyal to the emperor were arrested. In Hamburg and Bremen, "Red Guards" were formed that were to protect the revolution. The councils deposed the management of the Leuna works, a giant chemical factory near Merseburg. The new councils were often appointed spontaneously and arbitrarily and had no management experience whatsoever. But a majority of councils came to arrangements with the old administrations and saw to it that law and order were quickly restored. For example, Max Weber was part of the workers' council of Heidelberg, and was pleasantly surprised that most members were moderate German liberals. The councils took over the distribution of food, the police force, and the accommodation and provisions of the front-line soldiers that were gradually returning home.

Question: What tasks did the councils control?
distribution of food, the police force, and the accommodation and provisions of the front-line soldiers that were gradually returning home