Add test for blank query validation
Refactor schema to include result_group table