President Obama wins second term