added option to set custom api output path