added e2e test, and quite hacky script to run tests. also fixed a broken query that the test exposed