Adding API function.