Refactored http request into its own base class for simplicity and reuse.