Refactored the front end

Front end clean up and updated the APIs.