The quick draining and slow charging could be a couple different things going on. If the battery itself is going bad, it can cause both. If the loss of capacity and slowing of charge are about the same in how drastic they are, that could be it. If it's only a small loss of capacity, but a drastic change in charging times, then I doubt this is your issue (though the battery can certainly be showing signs of aging). Shutting off sooner, like at around 20%, because it now thinks it's dead is another sign of a bad battery.
Slow charging could also be a hardware defect. This usual suspect is the USB cable itself going bad, and also the cheapest to replace. The charger itself could also be bad. Unfortunately, the M8 seems to also be prone to the port itself going bad. If that's the case, it'll require extensive repair, and should be serviced by a shop.