Standardise JSON responses and fix imports