initial round of changes to http api
api refactoring