Log doc ajax errors

Added logging of doc upload ajax errors. Set a simple alert message for
500 errors to tell the user something went wrong.