Use getApi() and setApi() instead of deprecated api()