Added error object and expanded the logging object

Also added some error default styling
Added the database connection