Fix errors in API