started doing error handling like in Wcf, fixed tests