added proper API check