Server with working digest authentication and JSON file writing on succesful authentication, now with app (cleaned code)