Pull Request: Added appropriate Ajax responses.

I added appropriate Ajax responses for all responses so you can now do this in JS.

    // Stop form from submitting
    
    $('input[type="submit"]').on("click", function(event) {
      event.preventDefault();

      $.post('/', $(this).parent().serialize())
      .done( function(data) {

        if (!data.success)
        {
          // there was an error, do something with data
          alert(data.message);
        }
        else
        {
         // Success
         alert("WEEEEEEEEEE");
        }

      });
    });