This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Perhaps you get better luck in a Unix (or Linux) forum, but here goes my 2 cents. This is what I got from your post: /etc/init.d/api is your service script. Inside the script you are defining a variable called st with the command line you want to execute.
However, you have spaces in your command line so it is not recognizing the entire line as the value of the variable. It should work if you put single quotes around it like: