Fix passing params to API server

Also now prints result from server to in-page console.