fixed request parsing and responding