Whenever an error occurs in the api.sh script we want the script
to end and propagate the error upstream to whoever was invoking it.
This would allow the use inside a continuous integration system
and properly detect and notify failed or incomplete builds.
Change-Id: If64853d9c876e7f013bb96bcb911a6492d1a6ce6