jQuery AJAX submit form
You should first check if the response is null. If not, then check for a success or error response.
You can use a try-catch block to check if it is valid JSON:

Try{
    JSON.parse(response);
    catch(Exception){
    console.log("Not valid json");
    handle();
}

If what you are expecting from the server to be in a constant format you could use the callback code again and again in different functions.