feature #149 make common reusability code of api/library action