The preamble to the constitution says: "We the people, of the united states, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare and secure the blessings of liberty to ourselves and our posterity, do ordain, and establish, this constitution, to the united states of america." I think that the phrase that demonstrates the powers is, " form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare and secure the blessings of liberty" Hope this helps!
What the Treaty of Ghent did achieve to which it ended the War of 1812 was it set up a peaceful process for settling future disputes. The war was between United States and United Kingdom and the treaty was signed on December 24, 1814.