removed rails dependence and modified api name