start refactor into http api / restful concerns etc