Fixed some AJAX logic (more to come).

Write code -> check it in -> Test -> Wingging!