Lapis: split /db and /queries into different handlers