The bombings were the last straw that forced some very uptight men in charge to surrender. While many civilians were ready to throw in the hat and more or less hated the war by then, the emperor and his legion of followers would not have stopped.
I mean, they tried to hide the fact from the rest of Japan that the first atomic bomb hit. That's hardcore. It was only until the second bombing that flags were raised.
Was it needed? Yes and no.
Yes in the sense that it stopped everything.
No in the sense that it was the Atomic Bomb and they dropped it on harmless civilians. They could have invented a better bomb that didn't cause heaps of radiation and disease. I'm sure dropping another heavy impact bomb much closer to where the someone more or less important hanged out would have had a faster response - though it would have been harder to achieve. Then again, if such a bomb could have been carried on a single plane like the A-bomb, things are always plausible.
One thing that I hate about the Atomic bomb is that, due to the bombing in Japan, world leaders are now trying very hard to prevent another one. We basically said, "Hey, this is what we did, how we did it, and what happened. Okay, Iraq, South Korea, all you crazy guys, have fun!"