#169 api doc fixed. debug script fixed. api test fixed