First working version. Login authentication still needs to be added.