Fixing the bug with Resource API