Manchester City kept up their perfect home record thanks to a 2-1 victory over Liverpool in an exhilarating encounter at the Etihad Stadium.