I have an idea for an API and I have a good Idea of the functions, but I don't know how to define that it's a new API. Is there some sort of function I use or do I just create a table?
if you already have the functions (say, in a test program) then you just need to move those functions into a new file, and load that file with the os.loadAPI call mentioned above
if you call your "file-o-functions" something like "fred" then
os.loadAPI("fred")
will then allow
fred.someFunctionInYourFredFile( params ) to be used
that's the basics which will allow what you have to be used… remember that in the api file, you can have local functions and non-local functions, if you define one as local then it will be internal to the api only (for example, a helper function that only the api needs)
remember to keep any variables in your api file local where possible…
more details in the above replies of course, but related to your question, and assuming you have some functions already, those two steps should bootstrap you quickly