Fix http status codes and error responses