Revert "Fixing api.c (part 1)"

This reverts commit 4baa8faf8a3aeee57227a760a67f82dfd7a6ba4a.