Update api.js to return array of notes