Base API Handler