Said mayor and council shall have the right to acquire by purchase, rent, lease, or gift any cemetery or burying ground for the use of the public, either within or without the limits of the municipality, and shall have exclusive jurisdiction over the same, with the right to divide the same into lots, and to construct, grade, pave and improve streets and sidewalks therein; to sell and convey the lots therein to purchasers; to provide for the upkeep and maintenance of the same; to provide by ordinance or resolution for the infliction of penalties upon trespassers therein, to regulate the charge for digging graves, and to do any and all things necessary for the upkeep, preservation and maintenance of any such cemetery or burying ground.