refactoring; adding option for api prefix