Update code for test.
Add fetch function.