fixed error where invalid include name would cause hang

Fixed an issue where submitting an invalid include would cause the request to hang.

Solution was to add some defensive coding as currently the code assumes that the path exists in the schema. If it doesn't we get exceptions and the promise never resolves.

Added guard to that if path (include name) didn't exist in the schema it wouldn't cause a crash:

     if (_.isArray(schema[path])) {

Same thing with the line here:

     if(relation && relation.external){