handle included models using an alias

If you passed a model into the includes for the rest resource using
an 'as' alias, our logic would not remove the internal database
identifier from the resulting json representation of the data. This
is a bit of a contrived example, but certainly exposes the issue
along with the relevant fix.