Cardiff City's first top-flight outing in 51 years ended in defeat, with West Ham United collecting a comfortable 2-0 victory at Upton Park.