Send response in JSON format. Also set appropriate status code so that sender knows if the operation was successful.