Replace RAILS_DEFAULT_LOGGER with Rails.logger
Fix JSON encoding

Encode the whole request body as JSON and don't double encode the user data.