moving curl calls to bash script