Some fixes to api.