improve api return value
Merge pull request #1508 from craigh/apifix

improve api return value