support JSON and XML for RESTful web service