Towards Imitation Learning of Dynamic Manipulation Tasks: A Framework to Learn from Failures