Added all flags and refactored request handlers to access data off application.