Merge pull request #4 from 30x/XAPID-1035

[XAPID-1035] add more tests db quries, fixed bug