fix lots of api stuff