Cleaned up API and added HalJS invalidation