Added xhr handler and html code generator.