almost final changes made to controller
Merge pull request #17 from girb0t/database

almost final changes made to controller