Added status code to error json
Added coverage for 404 errors
Changed start and end nested context blocks
Moved attributes into attribute helpers
Attributes are sorted to have references first