fixes for api and some related jazz