ME: refactored 'labels' action to fix type error
ME: added a test for labels action
Merge pull request #674 from onaio/512-accessing-data-endpoint-with-label-triggers-error

ME: refactored 'labels' action to fix type error