refactor to remove http dependencies from this project and enable it as middleware