In order to create API's you'll need to declare some functions inside of a file, like this:
function FunctionName(arguments to pass in)
Code to run based on the arguments
end
So, with that being said, i can create a function like such:
function add(a,c)
return a+c
end
add(8,2)
returns: 10
Now, lets say you need to create a function only to be used internally, not by a user.
local function internalAdd(1,2)
return 1+2
end
This would now make it so you can only use it inside of the API itself.
When creating an API, you should name it something relevant to the usage. If its an API to write to a file, you could make it, 'fileWrite'
Note: You can have more than one function in an API. You can have as many as you can think of!