Added the cAPI code!

Man that took a while! Hope this helps with capes!
Merge pull request #4 from Mitchellbrine/patch-1

Added the cAPI code!