The correct answer is James K Polk.
The Mexican-American War started after a military dispute between the US and Mexico over territory near the Rio Grande. After this, Polk asked Congress to declare war which they agreed to. The end of the Mexican American War saw the US gain significant territory. This includes modern day Arizona, California, New Mexico, Utah, etc. The question now became whether or not these new territories would have the institution of slavery.
The question as to whether or not these new territories had slavery became a heated topic between the North and South, as this would determine control of Congress. Ultimately, this issue is settled with the Compromise of 1850.