Bug fix in API