Referring to Customfields

Hi all,
I’m making my first app and have created custom fields through the manifest of my app. When I refer to the custom fields in the development enviornment it all works well, but when I took it to production the number of the custom fields change. How can I refer to the custom fields if their number changes?

Another question I have is that rest APIs I’ve been similarly running for a long time in development environment, don’t work in the production. I get an error that it " is not a legal HTTP header value". Any clues to what can be wrong?

Many thanks,