this is stupid. need to start using testing framework, mocking, restful api library and ORM or its all just a pile of shit. rework needed.