Authentication Logic
added seperate namespace for api