Implement most HTTP parts of the protocol