fixing the types, they're actually undefined
some syntax clarification
fixing the callback so it returns data, not an error