add debug flag for api
Merge remote-tracking branch 'origin/master'