rework web api error handling and spot_mini_debug