updating api.js to include purge and loadChildren