West Ham United have taken advantage of poor defending to score twice and beat Newcastle 2-0 in their English Premier League clash at St James' Park.