Refactored Attempt Logging.

There was an issue when the EventAPI responded to a request with an html
response, and not a json response (as is currently the case w/ 500s).
I decided to refactor the code to make it easier to extend and debug
in the future.