Update api.rst

is an -> if a
Merge pull request #1269 from pkuphy/patch-2

Update api.rst