Change api to rest framework