test: Convert API tests to lua