used the built in Rails::API.rails4? call instead of my hacky one