lots of refactoring to start accommodating post requests