Backend code review and cosmetic fixes
Merge pull request #41 from anryko/master

Backend code review and cosmetic fixes