adding most of db related requests
add plugin activation/deactivation hook
refactoring, permalink improvements