Added api tests for flask.

`.decode()` had to be used to iterate through response data.
A try except had to be used to test a function in which
exceptions were expected.