Refactored and made better. Dispatches events now. All http methods supported.