Fixed error messaging and logging. To implement Request logging.