implemented api view using rest_framework