Switching between JSON and XML implemented.