There are a *lot* of ifs and elses and else ifs and conditions in this method. It's really hard to follow. Can you at least extract out the conditions from each of the if and else ifs into a named variable that makes it clear what the condition is checking for?

For example,

```javascript
var isPrivateInstance = parsedRequest[ 'instance' ] == undefined ) && ( parsedRequest[ 'private_path' ] == undefined;
if ( isPrivateInstance ) {
    // do stuff
}
```

I think that will make it a little easier to follow, and perhaps to factor out some of these code branches.