They won't give him a break – literally so. Barack Obama has reached that point of his presidency when he can't even join his fellow citizens in the all-American tradition of the August vacation without taking a hit. One group of critics attacks his choice of destination: Martha's Vineyard on Cape Cod is too swanky for them. Another band of hecklers says he shouldn't be on holiday at all. Chat-show host David Letterman wisecracked: "He'll have plenty of time for vacations when his one term is up."

This sounds ominous. Obama is becoming so unpopular that the kings of network light entertainment can suggest he will be a one-termer. Some of the panjandrums of punditry say the idea is no joke. In the midterm elections in November, the polls are currently predicting big gains for the Republicans who combine being furious and fired up with being hypocritical and nihilistic. The Republicans seem to have a very good chance of taking control of the House of Representatives and the possibility of seizing the Senate too. If the Democrats go down in big numbers, it will be seen as a referendum on the man in the White House.

How did this happen? Obama has many more positive entries in the ledger than negatives after 18 months in the Oval Office. He has delivered landmark change to healthcare. The reform may not be perfect, and it may not yet be very popular, but that is a big legislative legacy all by itself. Healthcare reform utterly defeated Bill Clinton in his first term. Other modern presidents didn't even try to address one of America's most intractable problems. In the face of ugly and unyielding opposition, Obama brought it home.

That's one item in a long roll call of substantial delivery, including a $787bn stimulus for the economy, groundbreaking change to the regulation of Wall Street, an anti-age discrimination law, reform of the corrupted student loans system and a tax cut for 95% of Americans. Republicans bitterly fought most of it in Congress and lambast it to the voters. But even they, albeit quietly and grudgingly, agree that it is a record of legislative accomplishment unmatched since the Great Society programmes of Lyndon Johnson in the 1960s.

Obama has put America's most effective general, David Petraeus, directly in charge of the conflict in Afghanistan and presided over a rethink after years of failed strategy. (Whether the new one will be any more successful remains to be seen.) He has ended major combat operations in Iraq to the schedule he promised. He has done so without peddling Bushesque delusions that Iraq is a mission accomplished. He has nominated two impressive women to the Supreme Court. His White House has been a dignified place. It has not been mired in the personal scandals that emasculated the Clinton presidency or riven with the infighting that riddled the Bush administration.

Flawless, he isn't. But all in all, Obama has largely turned out to be what he promised to be: a creative, pragmatic reformer.

Abroad, he has also scored some successes. He has reset America's relationship with Russia, partly in the hope of tightening the pressure on Iran. He will welcome the Palestinian premier and his Israeli counterpart to the White House on Tuesday to kick off the first face-to-face talks in 20 months. He has repaired America's reputation and relationships with Europe. He has reached out to the Muslim world, sought to strengthen alliances in Asia and striven to work with, rather than against, other countries and international institutions. The world no longer lives on edge for fear that a crazy idea might pop into the head of the White House, a welcome change from the Bush years.

For what deserves to be regarded as an impressive start to a presidency, his reward has been a steep decline in his approval ratings and the threat of a drubbing for his party in the midterms. Part of the explanation is to do with him. He arrived in office on a high tide that was always going to ebb. He was not only the first black president, he was also supposed to be the liberator and transformer of his country. Obama, the candidate-messiah, set a benchmark that Obama, the actual chief executive, was never going to match however much he achieved. Some falling off was inevitable. And that was just with those who actually voted for him. It is worth remembering that most Americans didn't have anything invested in Obama in the first place because they didn't elect him. They stayed at home on polling day in 2008 or backed his opponent.

Another part of the explanation is about the Democrats. They could be revelling in their achievements, but they aren't. Senator Christopher Dodd, a veteran Connecticut Democrat, says: "Democrats don't know how to celebrate." The left of the party has been churlish about Obama's record, bemoaning the necessary compromises of power as betrayal. Robert Gibbs, the White House press secretary, complained that leftish critics of the president "ought to be drug-tested". It was impolitic to say that in public, but he was correct. The rest of the party has been cowed by the aggressiveness of their rightwing opponents. Democrats have become defensive about the size of the deficit and the controversies over health reform, with the result that many are not talking about either the stimulus or their most important legislative achievement in many years.

Weeks before the election, Democrat strategists are agonising in public about what went wrong and generating a cacophony of contradictory advice for Obama. Be more populist, cry some. Be more serious, aver others. Do more to woo the swing voters, say some; talk more to your base, say others. Be more bipartisan, advise some; beat on the Republicans, say others. They are conducting the postmortem before they have seen the body.

The most important component of the explanation is the Americans. They are not a happy people. The main cause of their discontent is a limping economy. For all the billions poured into stimulus, the unemployment rate is around 9.5%, nearly two points higher than when Obama took office. That official statistic masks a real level of joblessness that is greater still.

The Democrats can and do say that the Great Recession was inherited from the Republicans. Bush is still an unpopular figure, but he is of diminishing use to the Democrats as an alibi. A recent poll has about three-quarters of voters saying Obama should take responsibility for the state of the economy. Memo from America to David Cameron and Nick Clegg: in modern politics, blaming the last lot starts to lose effectiveness after about 18 months. It is the economy above all else that has put Americans in a mood which is one part sullen, one part insecure and one part angry. The obvious place to dump all that bad feeling is in the trash can marked government.

Americans don't actually hate government quite as much as they think they do. In the summer, they flock to the superb national parks, which are run by the government. Those Americans who go on vacation to Washington, the capital they are all supposed to despise, will reverentially queue to tour Congress and the White House and pay their respects to the Jefferson, FDR and Lincoln Memorials. They have spent this summer cursing the traffic jams which are the result of the Obama administration's spending on repairs and improvements to infrastructure, but they will love it when they have better roads and bridges to drive along in the SUVs manufactured by GM and Chrysler, the motor giants saved by government.

But in straitened times, government is the default target for Americans' discontent. It is from this that the rightwing and racist-tinged Tea party insurgency, which is feeding off the anti-incumbency mood, has prospered.

Midterm, the prognosis does not look at all good for Obama and his party. In the longer term, the outlook is more encouraging. The Tea partyists are destroying moderate Republicans or forcing Republicans previously considered to be centrists – John McCain is the best known example – to move to the right in order to save their skins. The Republicans will ultimately suffer from being dragged further away from the centre.

The economy will not stay this way forever. All bets are off in the event of a double-dip, but if a reasonable level of prosperity has returned by the time of the next presidential election, Americans will be feeling better about themselves. That will put them in more of a mood to appreciate a generally impressive president whom the world regards as a credit to their country. Three of the last four presidents were re-elected having been in dire positions – much worse than the slump affecting Obama now – during their first term.

My money is still on Obama winning a second term and probably handsomely. And if he doesn't? He has already accomplished more in half a term than many presidents manage to achieve in two.