What do you mean group them by input? Can't you just parse the result?
"txs":[{"result":-166022157,"vout_sz":2,"hash":"2fe6774ffba3ad5b1d57afc920a2f31041d877312d6fbfa0bbf15fbdef4b00cd","vin_sz":2,"tx_index":53614189,"ver":1,"size":374,"balance":50000000,"time":1396263660,"block_height":293382,"inputs":[{"prev_out":{"n":1,"value":40000000,"addr":"1DyYRc2iD3MRrrQyXQNLDUmLJpGxDmV6Y7","tx_index":53613184,"type":0,"script":"76a9148e5308ed5be6760a680770dcd1bdeefdbc8ecf7f88ac"},"script":"76a9148e5308ed5be6760a680770dcd1bdeefdbc8ecf7f88ac"},{"prev_out":{"n":1,"value":166022157,"addr":"1HxYTGPikRDJ6ybKbGjzvmrKbdQiSHh6An","tx_index":53595165,"type":0,"script":"76a914ba03255d6e3117b6a80cd41426ab64df8860b99b88ac"},"script":"76a914ba03255d6e3117b6a80cd41426ab64df8860b99b88ac"}],"relayed_by":"127.0.0.1","out":[{"n":0,"value":40000000,"addr":"18ehHHziH1DyMXvwQAnc9as1hXdAyxPEzc","tx_index":53614189,"spent":true,"type":0,"script":"76a91453e9e558cfaeafa01497080b4618296efac5c55d88ac"},{"n":1,"value":166012157,"addr":"17FGSh5JqbSwsx3xbKfxTE3kdtkAB3t9zn","tx_index":53614189,"spent":false,"type":0,"script":"76a91444837823716a3119e90b0b37d3a0ea473ec260b188ac"}]},{"result":166022157,"vout_sz":2,"hash":"5ddd47e94b55a12da491b24a36a659a0ec114ef01a2ee9c82e9cf1f645f38aca","vin_sz":2,"tx_index":53595165,"ver":1,"size":374,"balance":216022157,"time":1396238495,"block_height":293329,"inputs":[{"prev_out":{"n":0,"value":2450000000,"addr":"1GgRNfLapNCkLy5vSg3yFKZe46JGj9biX","tx_index":53595160,"type":0,"script":"76a91402f72551ce16cfa94fadbcd31161d2e11d58058288ac"},"script":"76a91402f72551ce16cfa94fadbcd31161d2e11d58058288ac"},{"prev_out":{"n":1,"value":166032157,"addr":"17rNybRxpyvWamMbLJi2yFGUjXUfAzPDqV","tx_index":53572503,"type":0,"script":"76a9144b277b3425b39bd660615dea346cd62e66d9755b88ac"},"script":"76a9144b277b3425b39bd660615dea346cd62e66d9755b88ac"}],"relayed_by":"127.0.0.1","out":[{"n":1,"value":166022157,"addr":"1HxYTGPikRDJ6ybKbGjzvmrKbdQiSHh6An","tx_index":53595165,"spent":false,"type":0,"script":"76a914ba03255d6e3117b6a80cd41426ab64df8860b99b88ac"}]},{"result":50000000,"vout_sz":2,"hash":"f77dc7617bc0aee2a94c438804e6b2156d8f5d2d2ad265dbe99af785d007bcda","vin_sz":1,"tx_index":53530007,"ver":1,"size":226,"balance":50000000,"time":1396151405,"block_height":293180,"inputs":[{"prev_out":{"n":1,"value":600000000,"addr":"19BEGrkEoj2A4PzYASQyQB4PWkwjBHbYv4","tx_index":53339529,"type":0,"script":"76a91459b03ef7fab410f793f121adc091b633772e06bd88ac"},"script":"76a91459b03ef7fab410f793f121adc091b633772e06bd88ac"}],"relayed_by":"129.132.230.77","out":[{"n":0,"value":50000000,"addr":"17BAPwLRZq9zpwwEeow9rBwb1TAypkp2jC","tx_index":53530007,"spent":true,"type":0,"script":"76a91443bcc1db9fc30b9df8fe404347341e3c2634e25e88ac"}]}]