fixe and cleanup for API query speedups that I didn't mean to include.  Good stuff though\!