Worked out errors getting data from couchDB.