refactor HTTPAPI spec