The previous code works fine when running specs, but the API does not exist outside that environment.