tweaks to api and minor fixes