Add json to error
add verbose option
fix printing to stderr