Improve validation of Baron response during invoice creation

* Invoice POST responding with the wrong JSON previously could cause Adness to crash.
* Remove some code duplication.