Big server performance improvement

Dramatic reduction of sql requests done to sqlite database = way faster!

This concern non-token authentication methods.
Token based authentication will be improved in another pull request.