fix sql for user data
refactor api key generation methods
dont output debug info when debug is disabled
replace all config variables
replace js config and refactor code