let json return custom failure codes

now, we can return a custom failure message.