Add curl init and close functions