Wrap Active Record PostgreSQL queries so they directly return json.