add xml and json middleware