redundant code deleted in index.js. does now access the api