What led to the war of 1812 and what was the outcome?