Fixing settings save bug
Fixing app id bug, saving settings
Fixing multitenancy bug, cleaner db code, settings