add api return statuses and consolidate authentication