added logging to debug api end point