Base class that handles request and response