bug fixes for api