Adding success and failure functions for formatting responses.
Merge pull request #1 from cl-tford/master

Adding success and failure functions for formatting responses.