Refactor jsonapi to package