added a macro for returning a json error message