Changed key names 'end' to 'ending' for compatibility and updated testing unit