Refactored HTML & HTTP APIs