The City Attorney shall be the legal advisor of the city, and shall render advice on all legal questions affecting the city, whenever requested to do so by any city official. Upon request by the Mayor or by Council, he or she shall reduce any such opinion in writing.