refactor to implement API
Implement simple WebAPI