Added tests for API views.
Checking if item exists before trying to converting it to dictionary in item_data API endpoint.