Fixing errors in API