Added authentication and tests