First cut HASH API, few bugs fixes and improvements