Implemented to addition of earned badges to the database
Also added support for cases when something needs to be saved, but no internet connection is available