Fix error using PouchDB, add support with angular-pouchdb