Adding error handling and database insertion for basic stuff.