Making IK rig for imported Source engine game skeleton?

My bones for this game skeleton are parented and not connected. I want to make an ik rig for it, for the arms, legs, and spine.

the arms and leg ik seems to work, but im not sure how to make it for the spine.

using the inverse kinematic constraint on the top spine bone seems to contort the skeleton weirdly. im also not sure how to make it so moving the pelvis bone doesnt move the whole skeleton. heres a blend file of it if anyone needs it.

skeletonimport1.blend (653 KB)

so if anyone has any tips on making ik rigs with skeletons like this, let me know. ive imported the skeleton from a source engine game.