first version of api to serial script