created a libray file and used it in products api