clean up
better error handling
minor tweaks
skeleton of mock data functions