Added code to end server response if no event url is passed so that a timeout doesn't occur, and minor code cleanup