Fix ref API and docs