Fixed promise call.
Merge pull request #364 from akoenig/api-post-bugfix

Fixed promise definition.