Renamed core to api.
Moved api functions to api.js .