Issue 898 api fix

Fix for querying DomainObjects with id==0