wrote test for callbacks on success and errors, and fixed that actual code