move returnType into context and add api-doc return type