making python module
fixing a few copy/paste bugs, also getquery returns an object of data now