added http handlers chain, added various tests as per protocol-test