added offline api support