feature parity with api.py (woo-frekkin-hoo!)