return JSON-style nested hash for REST API