Clean up empty service APIs with empty outputs
Expose global variables in console script.

* Ensures that "data" and "error" are always present (even if no request was
  sent).
* Exposes "request" variable
* Renames "resp" to "response"