Modify the fetch.js to send json to database.