Fix empty queries from throwing error

Empty queries would result in the ORM throwing an error
or failing.  Instead, guard against empty queries and
return the empty set.

This was reported by @katucker

See issues:
https://github.com/HHSIDEAlab/midas/issues/29
https://github.com/HHSIDEAlab/midas/pull/32