added api key, completed js functionality