[#17] change on api middleware / helper logic