Implement authentication in API