Bug:
-1.The time.sleep() removes the special ability of running program code asynchronously.
-2.The error handling is weak in '/delay' endpoint because when '400' error is raised it doesn't get handled and get converted into '500' error.
Fix:
-1.-Add 'import asyncio' in program.
-Add asyncio.sleep() in place of 'time.sleep()'.
-This retain the power of async in program.
-2.-Add the 'HTTPException' in '/delay' endpoint code block to handle the '400'error.