add handling of plugin functions arguments
add error handling when wrong API function is invoked