Add Authentication and Cleaned up JavaScript.