refactoring

use render :json => foo instead of render :text => foo.to_json