Did the U.S. accomplish the goals that it had for the Korean War?
This depends on what you think the goals of this war were. They were different for different Americans at different times.
For example, some Americans wanted to use the Korean War to attack China and end communism there. Clearly, the war did not accomplish this goal. So, if you think the goal of the war was to end communism in North Korea and/or China (which it was for some Americans) then the US did not achieve its goals.
However, it can be argued that the goal of the war was to throw back the North Korean invasion and to maintain South Korea as an independent nation. If this was the US's goal, then the war clearly succeeded in achieving it.
The question of the US's success, then, depends on what one sees as the goals of this war.