Basic Auth and Ratio Group support

Not sure how you would prefer these changes, I could split this into multiple pull requests if needed.