refactored some cookbooks and added elasticsearch API scripts.