Minor refactor.
Return bad request if data is missing.
Merge pull request #425 from git-harry/sprint

Merged automatically by jenkins after successful gate test