Cleaned up ServeJson and ServeXML methods to prevent rendering issues