Moving constants to common
Doing server side validation. Fixes #10