You need a point in between the start and end points. That way the tangents will point towards the middle point.
getNumSpline points returns the actual number of points but spline points are numbered with a 0 based index. So the first point is numbered 0 and then 1 and so on until the last one which is equal to numberOfPoints-1.