Fix code review issues
Add tests for fetch callback