Fixes to api