Without changing any logic, you can add a uniqueness validation rule to the identifier and this will prevent duplicates with the downside of getting errors: uniqueness is checked in the database.
Alternatively, you can rethink the way you set up this API. Typically, when an external system POSTs information, you decide the identifier which this new object receives. Therefore, it doesn't make much sense to POST to /resources/identifer: you would typically POST to /resources. The object that is being posted may have an identifier which is known in the external system, but that should be present in the content and stored separately. You can now hand out identifiers in a way you see fit, using UUID's (see CommunityCommons GetRandomHash), using the objects internal ID (see CommunityCommons GetGUID) or any other way to generate an identifier. Even in this scenario, it may be worthwhile to use a validation rule.
Does it help for you to use a local database to handle the user data? This makes your app faster with a better user experience.
To exchange from your local database with the API’s you can use scheduled events. This avoids concurrent call’s to the same endpoint.