Obama should have handled this in a totally different way, he should have treated him as a partner for having shed light upon a corrupted practice of the NSA, and should have asked the people heading the NSA to resign.
This would have been a checkmate against any other US antagonist in my opinion, but I admit that is definitely too easy to judge things you don't know in every aspect from the comfort of your own home.