BZ-1074989 - REST API returns HTTP code 500 (compilation fix and cleanup)