Split read and write API functions into two files as write functions will need to use pouchdb.