Cleaned up the click handler for the .ajax request

-The click handler was missing a preventDefault call, which was causing it to do strange things (mainly, the ajax call was failing)
-Added an error handling function the ajax call is something happens to go wrong