changed apiUrl to use env var with a default