use $resource instead of hard coded result.

CORS is needed already, even for localhost communcation