add unit test to verify callbacks in data handler.