fix and test methods of authenticating before posting data