President Obama was right in releasing the five terrorists in exchange for Bowe Bergdahl. The man has fought for American freedom and Obama saw an opportunity to save his life. Yes, the decision may blow up in his face, but for the time being all is well. Obama released the prisoners on good faith and vows that he will keep a close eye on the released prisoners.
There is long-standing historical precedent for trading prisoners of war with hostile nations. Considering the fact that the United States has been holding these five prisoners, among many others, in total violation of the Geneva Conventions and the US Constitution, the US should not have even had them in the first place. Getting one of our own POWs back in return is a bonus.
I think that the president was well within his rights to do the prisoner exchange, however I don't think that it was the right thing to do. I believe that perhaps they should have done some more research before they put themselves in this position, and that they should probably conduct some tests on the man to check for a pre-existing mental illness that would be the cause of the man's actions.
No, the President of the United States was not within his rights exchanging five terrorists for Bergdahl, because they did not have the rights under international law to negotiate and effectuate that exchange. The laws that pertain to war do not give a president the right to make extrajudicial decisions on prisoners of war.