Fixed web service so it makes hql queries

...instead of sql queries, which are evil according to David and had to
be removed.