Fixing 400 error when retrieving resource