Did specifying:

`var root = that.resources[apiRootPath] = that.resources[apiRootPath] || {`

... not work out? If we do it that way, then this if statement is not necessary.