added callback support into mock.js and its test