added xml and json support