Updated to handle auth and removed jQuery