Updated postcontroller to add validator for posts