hacked together initial version of api