support using return instead of module.exports to export api