Fix support for custom root in JSON-API adapter