fixed bug where null value keys are left out of the response, improved speed