public static ServerResponse updateUserWidget(long widgetID, WidgetModel widget) { WidgetModel oldWidget = SqliteHandler.getWidget(widgetID); if (oldWidget == null) { return(new ServerResponse(false, "widget not found", null)); } SqliteHandler.updateWidget(widgetID, widget); oldWidget = SqliteHandler.getWidget(widgetID); return(new ServerResponse(true, "widget updated successfully", oldWidget)); }