Correct (and defensive, and ugly) JSON expires_in handling