rest.go refactored to only use context map

a