A city shall have the power to compel any water company, gas company, or other person, corporation, or firm owning or controlling any pipe or other underground conduits or other appliances usually installed under the surface of the streets, to provide for and construct all connections that may be deemed necessary for the future, to the curb or property lines in all streets, highways, boulevards, controlled-access facilities, main thoroughfares, connecting links, major traffic streets, or alleys to be paved, repaved, or otherwise improved in such manner and in conformity with such plans as may be determined by the city. If any such companies or other parties shall neglect to carry out such construction or fail to make the connections required within thirty days after such connections shall have been ordered, the city shall be empowered to cause such connections to be done. For the purpose of paying for such connections, the cost shall be deducted from such accounts as the city may have with such companies or persons.