seperate curl call function