lots of bug fix, http server now works