restructured code
added emptySeries option
fixed authentication