Set api base

Add an option to set the api base.