setup api on first use so we have access to config.