Is it possible to create SplinePoints in nurbs Spline with ctypes?

Hi. Iam trying to remake spline points in nurbs spline, but have problem - Blender crushes if i switch from edit mode to object mode. In Python API cant found way do delete specific control point,so im trying to remake them with this code.It adds new points(in edit mode), i can even move them))) but Blender crushes after switching mode(((

Python Code

P.S. I know that i can delete spline itself ad remake it, but in my case - it is not good decision, because i have references in custom properties to index of this spline. And i have to recursively change all splines indexes multiple times. It makes code for this simple task hardly readable.