Fixed type errror on api.py
Merge pull request #364 from miratcan/master

Fixed TypeError