Improve api view tests