Fixed the API server

@molinamiguel Review changes?