rewrote response serialization