Re-implemented API registration

and one more LUACL_UNLIKELY