api fix for issue #230 #281 #291

api fix for issue #230 #281 #291