removed unused public files, fixed sending headers multiple times