rest api create index takes more params
removed search code from index.js as it appears moved to search.js