Would it make the code clearer to use these as guard clauses and immediately return:

```js
if (err) return callback(err);
if (!(body && body.realm)) return callback(new Error('missing realm json'));
...
```