Update model.js

fix for empty result sets
Merge pull request #13 from sponnet/master

Update model.js