Add app startup restrictions
Remove unused todo
Move conf creation to app start
Fix unit test
Code cleanup and more error handling