(#215) Update API validators and add tests.

This updates the validators to be more field-specific, and adds
basic unit tests for each one. It also slightly improves the
regexes used in each validator.

Resolves #215.