Implemented authorization for API