Updated HOPE Api according to latest spec.
Updated broken tests and refactored code
Merge pull request #2670 from lwyszomi/Hope_API_update

Updated HOPE Api according to latest specication