I want build an Rails API which serves as backend for a mobile app. Since the mobile app will be used in offline mode. Hence I want data updates needs to be synced between mobile and web app. What would be the best possible solution for this kind problems?