getQueryParam('url'); if (isset($url)) { $this->video = $this->downloader->getVideo( $url, $this->getFormat($request), $this->getPassword($request) ); return $response->withJson($this->video->getJson()); } else { return $response->withJson(['error' => 'You need to provide the url parameter']) ->withStatus(400); } } }