api mock and code cleanup
more cleanup