added create file for database, implemented fix for session validation, fixed some bugs where things weren't being done in a proper async way