The town council shall appoint a town attorney and assistant town attorneys if necessary, who shall serve at the pleasure of the council. The town attorney may be responsible for representing and defending the town in all litigation in which the town is a party; may at the discretion of the council be the prosecuting officer in the municipal court; shall attend the meetings of the council as directed; shall advise the council, other officers and employees of the town, concerning legal aspects of the town's affairs; and shall perform such other duties as provided by the council.