My answer here is probably wrong, but seeing as no one else has answered I will attempt to answer.
From my experience defining variables in an api does not work. A way around this is by making the api return the value that you would normally assign to the variable. You would then do something like variable = api.function() in the actual program.
For this example this file is named api
function apifunction()
return "returning this string"
end
os.loadAPI("api")
variable = api.apifunction()
print(variable)
Edited by valithor, 05 November 2014 - 12:07 AM.