simplify json
output errors to standard out, give users a code instead