Connecting NgResource to DB