AI breaks down into two schools of thoughts. One school believes in programming. In other words, using massive algorithms to account for everything. The other school believes in modeling AI after the human brain by use of neural networks. Both of these have advantages and disadvantages, but one by itself is insufficient. Bridge these two and you have something to worry about
If you think about it, biological lifeforms have the same arrangement by use of DNA, neural networks, etc... As for creating AI's being dangerous; the real trick to ensuring AI doesn't take over at some point in the future is to arrange it that the AI is unable to maintain or reproduce itself.
"They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety."
-Benjamin Franklin