Changed api.lua to follow lua module conventions