Yes, Japan was ready to surrender under certain terms, and yes those certain terms were agreed to after the bombs were dropped, but there are certain mitigating reasons for those terms to have been acceptable after the bombs were dropped, but not before. Which is to say that the true devastation these weapons would wreak was not fully understood at this time, even by the people who created them, let alone the decision makers who signed off on their use. The blasts created in the tests were significantly larger than predicted, no one had real knowledge of radiation poisoning, and there is something to be said that they had only been tested.
What I mean by only been tested is that there was no real framework for people to understand these bombs. That framework has only come into place in the aftermath of their use on people. Think about how nukes are described to the layman, 5x the power of Hiroshima, 10x the power of the bomb dropped on Nagasaki, etc. It is through their use that we have an understanding of how dreadful these weapons truly are, but before they were used in combat that framework for understanding them just didn't exist. It is only with hindsight and pictures of the devastation they wrought that it really hits home in the mind of the observer. Yes, firebombing caused more devastation and loss of life, but that was hundreds of planes dropping thousands of bombs, it just doesn't have the psychological impact that one bomb has. That said, it is a good point that total war had made this kind of devastation a legitimate tactic of war, both sides had shown a willingness to kill civilians to achieve their goals.
At various meetings throughout the war - Potsdam, Yalta, Tehran, being the major ones - it was agreed that unconditional surrender was the only acceptable means of surrender. This was for various reasons, appease the Soviets, ensure hegemony over Europe and the Pacific, previous experiences from WW1. FDR was the spearhead of this on the U.S. side, but how much he confided in his Vice President Truman about the reasons and framework behind this aren't particularly clear. What is clear is that once Truman became President he had not been fully briefed on every situation and was playing catch up in all manner of areas, but it was important for him to be seen as strong, in command, and have continuity with FDR's policies amongst the political elite, as an election was on the horizon.
In combination with this, it was becoming very clear to the Western Allies that the Soviets were going to become their fiercest competition in the post-war world. The Soviets were making it very clear that they were going to brook no interference from the allies within territories they controlled, as they had been given no say in how Italy was to be governed when it was liberated earlier in the war. At the last meeting, Potsdam, when it was still looking like Japan would be able to fight on for a significant time, Soviet support in the Pacific had been pursued and assurances achieved that they would switch attentions over to the Pacific theatre at the earliest opportunity.
So there was an impending red tide just starting to push into the Pacific, which the allies were realizing they don't actually want, as the Soviet Union with warm water ports in the Pacific could threaten U.S. hegemony of the area in the post-war era; A President that felt he need to be strong and decisive, but didn't really have as firm a grasp on all the information as his predecessor had; and a new weapon that no one fully understood yet.
Yes, Japan was ready to surrender, yes it could have been accepted, but agreements had been made between the allies that unconditional surrender was the only option. However, it isn't completely clear if Truman had been made aware of all the reasoning behind the need for unconditional surrender, but his need to be seen to have continuity with FDR would have played into his decision not to accept the surrender offered, but strive for FDR's previous goal. Concerns about the Soviets annexing territory, or even a divided Japan, much like Berlin, would have also played a role in Truman's decision to drop the bomb to expediate Japan into accepting unconditional surrender.
However, once it became clear that Japan would continue to ask for the exemption for the Emperor, and the true horror of these weapons being used was starting to be realised, the surrender was accepted. It saved lives, on both sides, as any invasion would have been a horrific loss of life, but I believe it also saved many future lives, by showing the world the true power of these weapons when their use was confined to a unilateral engagement. Had the bombs not been dropped then and created the framework for how they would be regarded in the future, their use may have first been in a conflict in which both sides could bring them to bear, possibly legitimising their use as tactical warheads, or even worse ending in a full scale nuclear conflict.
That's what I can remember from my paper I wrote on it 6 years or so ago, I am likely forgetting things, mixing up a few things here and there, but generally I'll stand by it.