JSON api and allow error level changing from config