Added functional tests for the API controller.

Had to change the post controller to make it work with the API.
Error reporting now gone, will have to investigate this later.