Section 12. A city or town having public grounds or open spaces in any of its public ways, which have been or may be designated by it as not needed for public travel, may give the improvement thereof to corporations within its limits organized under section four of chapter one hundred and eighty, which, under the direction of the city council, selectmen or road commissioners, shall have the use, care and control thereof and may grade, drain, curb and fence the same, set out shade or ornamental trees, lay out flower plats and otherwise improve them.