Update index.js

Parse JSON when returning response directly