Add test that accessing a non-existent query generates a 404