Whenever any such company shall have been duly organized, it shall be the duty of the common council of any such city or village or the proper authorities of any such town, by ordinance, to grant to such company such right to the use of the streets, alleys, wharves (if any) and public grounds of said city, village or town as shall be necessary to enable such company to construct the proper works for the supply of water for the use of such city, village or town and its inhabitants; and the said common council may, in such ordinance, prescribe such just and reasonable terms, restrictions and limitations upon such company, in reference to the manner of using streets, alleys, wharves and public grounds; to the charging and collecting of tolls, water rents or other compensation for the supply of water, to be furnished by such company, to such city, town or village and its inhabitants, as it may deem proper; to guard against the improper use of such streets, alleys, wharves and public grounds, and to protect said city, town or village, and its inhabitants from the imposition of undue or excessive rates or charges for the supply of water; but no such restriction shall be imposed which will prevent such company realizing upon its capital stock and annual income or dividend of 10 per cent, after paying the cost of all necessary repairs and expenses, interest on all moneys borrowed and 5 per cent. per annum into sinking funds, for the extinguishment of funded debts.