Fix api call error in routes.js