Use `OC_JSON::error()`. `OCP` is for apps.