Allow customization of the API resources prefix (v2)

From #244. Also uses the prefix in the JS settings.