Fixed d is not defined error.
-Getting error d is not defined on api.js.