Allow customization of the API resources prefix (v2)

From #244. Fixes #104, fixes #244. Also uses the prefix in the JS settings.