Return appropriate status code on error
Merge pull request #8 from ncolgan/master

Return appropriate status code on error