Move some functions in jsonapi