Printing the status of a database insertion as JSON
This looks like you are trying to create a REST interface. If this is true, the following remarks apply:


First of all, your path should not include the action. The resource should be named "record" and the action is determined by the HTTP verb, i.e. "insert" is implied by POST, retrieve by GET, modify/update by PUT, etc.
Success or failure should primarily be communicated via HTTP status. For a POST, customary responses are either code 200 (OK) with the complete object as a result (often modified by the insertion, e.g. having a unique id now) or 204 (no content) to signify that everything is OK without sending the object back.
Likewise, failure should be communicated as a status code in the 500 range (server error, e.g. if the database connection fails) or 400 range (bad request, e.g. wrong data types transmitted by the client)


Generally, look around for "REST best practices", you'll find lots of information on the topic.