refactored code by taking out shell_exec and putting in native php curl methods
resolved conflicts