params['fields'] not defined properly when fields parameter not provided

Summary:
Refactored some fields handling code and introduced a bug that would sometimes
result in params['fields'] to be completely undefined.

Test Plan: run tests