fixed rest return code
added api key (env)