ALL things considered, US President Barack Obama will be able to look back at the year with some satisfaction.

In fact it could be said that he enjoyed a number of lucky escapes which prevented his second term from getting off to the worst possible start. In April a pair of rogue bombers in Boston awakened fears of a rerun of the 9/11 attack and heightened suspicions that national security was not all that it could be. But although three people were killed in the blasts and there was a farcical car chase, the Chechen brothers responsible for the killings - who were later found to have been involved in an earlier triple killing - were not the hardline terrorists originally suspected.

Also on the security front there was a rerun of a different kind with Syria almost becoming a second Iraq. Thanks to Obama's throwaway words about creating a red line should chemical weapons ever be used in the long-running Syrian civil war, the US found itself almost sleep-walking into another unnecessary war over possession of weapons of mass destruction. Thanks to the involvement of social media it was undeniable that chemical agents had been used in a suburb of Damascus in August but no-one really knew which side had deployed them - the government forces loyal to President Bashar al-Assad or the opposition Free Syrian Army.

Both sides had the inclination and the motives to use them in order to gain an advantage in the increasingly bitter civil war but there was no reliable evidence. Even so, the pressure to do something was almost irresistible and for a time it looked as if Obama would have to make good his threat that if there had been a transgression he would have to do something about it. The fateful comment had been made on August 20 when he held a news conference in the White House and explained his position: "A red line for us is we start seeing a whole bunch of chemical weapons moving around or being utilised. That would change my calculus. That would change my equation." At that point it looked as if the US would be able to create a coalition of willing partners. France, with their old colonial links with Syria, was especially bellicose, but the UK Government was less sure and having been wrong-footed in Parliament, Prime Minister David Cameron was forced to pull out of any military partnership.

That was a big blow to the US President and when Assad offered to hand over the question to UN chemical weapons inspectors he was let off the hook and the expected cruise missile retaliation failed to take place. As the year came to an end arguments still raged about how much Obama really knew about the whole affair and about which side was responsible for the attack but the fact remains that Obama did not make good his threat and, for the time being at least, another Western intervention was avoided.

According to US political mythology, every president entering a second term is plagued by a "curse" which means that the final four years in office will contain a major setback, usually unforeseen. Harry S Truman had to contend with the Korean War, Richard Nixon confronted the self-inflicted wound of Watergate while Bill Clinton had to come to terms with the consequences of his dalliance with Monica Lewinsky and his subsequent impeachment. White House watchers were convinced that Obama would come a cropper with his uncertain foreign policy but having survived the seemingly unstoppable rush to bomb Syria into submission, the US President ended the year on a diplomatic high when he attended the funeral of Nelson Mandela. Not only did his eulogy hit the right note but he appeared relaxed and self-assured, so much so that he was sufficiently confident to take the initiative in greeting Raul Castro, brother of Fidel, his country's long-term nemesis and bitter enemy.

In itself it was only a physical gesture at a funeral but it was a hugely symbolic moment and indicative of Obama's desire to seal his place on the world stage. That mood was reinforced when he also shook hands with President Robert Mugabe of Zimbabwe and greeted Brazilian President Dilma Rousseff with a kiss on the cheek despite recent tensions over the revelations of US spying activities. A similar gesture had been widely expected with the Iranian leadership following the recent talks which saw the US and Iranian presidents talking on the phone for the first time in 30 years. But in the end, the expected handshake with President Hassan Rouhani never happened, allegedly because of fears among Iranian diplomats that it would lead to criticism among hardliners at home in Tehran.

The second-term curse failed to materialise from the consequences of Obama's involvement in the wider world but that did not stop it from biting him where it hurts most: in his domestic policy. From the very outset of his presidency it had been clear that Obama's political rivals on the right would do their darnedest to halt his cherished healthcare reforms. So determined were they to get a result that October opened with the unusual prospect of the US government being shut down for an indefinite period, the first time it had happened since 1996.

Throughout the crisis Obama remained defiant, claiming that the Affordable Care Act was "here to stay" but hardline Republicans made it clear that they would not be moved until free medical care had been consigned to the political wastepaper basket. For the outside world and visiting tourists it was a mystifying, unintentionally humorous moment with government offices and all tourist attractions - including the Statue of Liberty - being closed down. Suddenly the world's mightiest power seemed to be entering a never-ending long weekend but for most Americans it was deadly serious as pay cheques failed to arrive and day to day life ground to a halt.

In vain did Obama accuse his opponents of mounting an "ideological crusade" and paint them as the villains. Like gunfighters facing each other in the midday sun, neither side would blink and as a result of their cussedness the standoff dragged on for a fortnight as the country became gridlocked. Eventually disagreements within the Republicans weakened their position and by mid-October Obama was home and dry, having held his nerve and successfully sidestepped any blame for the fiasco.

As the year neared its end, both sides continued to gnaw away at the issue, each claiming that a battle might have been won or lost but that nothing had really changed and the war was still to be won. Obama, though, was having none of it, telling Democrat supporters that they still held the moral high ground. "The shutdown was about more than just healthcare," he said at an end of year rally in New York. "It was about sort of a contrast in visions, what our obligations are to each other. And we've got the better side of that argument, one that's truer to our history." That may be so, but with mid-term elections in the offing, healthcare is still a live issue.