Not satisfied with code outcome for this api.