coding standards fixes
validate post types, and return an error messages appropriatley, closes #2