how to detect battery failure
The simple answer: yes. The are a number of lithium ion PCB that are created based on the number of cells in series. They will stop charge or discharge if any cell is over voltage, under voltage over current, or short circuit. Some of them can be customized for size of current etc.  search google or ebay for lithium ion PCB and you will find what you are looking for.