Section 37. For the purpose of avoiding, so far as practicable, during the period of public exigency, emergency and distress now existing on account of the acute shortage of housing in many cities and towns of the commonwealth, the making of persons or families homeless as the result of the demolition of dwelling units on land acquired or to be acquired for the purposes of an urban renewal project, or any other public improvement by the commonwealth, a city or town, or any other public body, the commonwealth acting by and through the department may enter into a contract or contracts with a housing authority, or, in the event an urban renewal agency exists within a city or town, with a housing authority upon request of the urban renewal agency, for state financial assistance in the form of a grant by the commonwealth of the development cost of a relocation project or projects. The total amount of grants so contracted for shall not exceed twenty-five million dollars in the aggregate or the actual cost of the construction of two thousand units, whichever amount is the lesser. Each such contract shall contain such limitations as to the development cost of the project and administrative and maintenance costs, as the department may require. Each project shall be based upon a separate application made to the department, which shall include such evidence of need as the department may require including a statement that the local planning board has been informed as to the location and number of dwelling units of the proposed project. The department shall ascertain and certify the need for each project after determining that there exists in such city or town and its vicinity a period of public exigency, emergency and distress occasioned by an acute shortage of housing; provided,