added final functionality to adding items to the database