Not able to run flows with prefect server locally

I have start my prefect server with “prefect server start” command and then pointed the API url to the same with this command - “prefect config set PREFECT_API_URL=http://localhost:4200/api”. But when I try to run the flow it gives me below runtime error - RuntimeError: Cannot create flow run. Failed to reach API at http://localhost:4200/api/.

Am I missing some step here ?