Avoid jsonifying undefined data

For example, when requesting a verification code, there is no JSON data
to send.