Fix issue from recursive dereferencing PR

My earlier pull request to make `dereference` recursive had introduced a bug: the `endpoint` view needs to access the first level of dereferencing of `identity` definitions, so I added an optional parameter to dereference only a single level (as was the original method did)