Catch invalid JSON

Currently, the ValueError thrown from trying to convert bad JSON is not caught. This should be caught and returned as an HTTP 400 error with a relevant error message.