Change tests to correctly look at json errors. Refactoring and comments on code. [MJ-342]