Revert "Fix compile warnings in api.c" This reverts commit 8a90f1a756b60914afe61b2ea7362313026a9f1a. Breaks windows build.