added free_variables function and getapikey