JSON wrapper class that knows how to throw exceptions on errors.