moved logic from controllers to models
Merge branch 'master' of https://github.com/isomoar/php-blog