Implemented recursive relationships for JSON/XML output.