Added response serialization and request header handling