updated api for frontend