cleanup and fix jsonapi methods