using bluebird promise lib, added custom errors