[api] Fix CastSpell bug. Update docs and tests.
Merge remote-tracking branch 'origin/master'