Generate and render errors
Catch exception thrown when parsing private key
Don't crash when content-type header isn't received
Add more error handling