Fixed an important bug in the 'add' method. Render method works for both JSON and XML