Bug fix in API check