Minor style fix: #pragma vs. # pragma
to_schema is now a proper class method
Stop using APIError, "message" key is now "error"