The town council shall appoint a town attorney, together with such assistant town attorney as may be authorized, and shall provide for the payment of such attorney or attorneys for services rendered to the town. The town attorney shall be responsible for providing for the representation and defense of the town in all litigation in which the town is a party; may be the prosecuting officer in the municipal court; shall attend the meetings of the town council as directed; shall advise the town council, mayor, and other officers and employees of the town concerning legal aspects of the town's affairs; and shall perform such other duties as may be required by virtue of the person's position as town attorney.