rails-esque environment checking in $api service. no API calls if env.test?